Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrows gets twice position:absolute #44

Open
dilyanpalauzov opened this issue Feb 8, 2022 · 1 comment
Open

Arrows gets twice position:absolute #44

dilyanpalauzov opened this issue Feb 8, 2022 · 1 comment

Comments

@dilyanpalauzov
Copy link
Contributor

https://popper.js.org/docs/v2/tutorial/#arrow suggests this call:

<div id="tooltip" role="tooltip">
  My tooltip
  <div id="arrow" data-popper-arrow></div>
</div>

and

#arrow,
#arrow::before {
  position: absolute;
  width: 8px;
  height: 8px;
  background: inherit;
}

As far as I can see, the arrow modified assigns the element with id="arrow" to state.elements.arrow. The appyStyles modifier sets state.elements.arrow.style.position='absolute'.

This means, that by following the tutorial the position style for the arrow-element is set twice to absolute: once using CSS and once by Javascript.

Please adjust either the tutorial, not to recommend setting explictly #arrow, #arrow::before { position: absolute }, or the arrow/applyStyle modifiers not to set for the arrow-element position: absolute.

E.g. the example shall set position: absolute for #arrow::before, but not for #arrow itself.

Moved from floating-ui/floating-ui#1528.

@hardiksharma11
Copy link

Hiii there .....
Is this issue resolved? If not I would be greatful to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants