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

Popper without any parents #136

Closed
adevnadia opened this issue Jan 8, 2017 · 0 comments
Closed

Popper without any parents #136

adevnadia opened this issue Jan 8, 2017 · 0 comments

Comments

@adevnadia
Copy link

When popper doesn't have any positioned or scrollable parents, its behavior on scroll is a bit broken. Examples:

Popper is okay, moves with ref element as expected:
https://codepen.io/nadiam84/pen/PWqVKo

Popper stays on the same place when scrolled, although it shouldn't:
https://codepen.io/nadiam84/pen/xgGMrz

The only difference in those two codepens is that the parent has 'position: relative'.

adevnadia pushed a commit to adevnadia/popper.js that referenced this issue Jan 8, 2017
FezVrasta pushed a commit that referenced this issue Jan 9, 2017
* fix popper's behavior when it doesn't have any parents (#136)

* cache getOffsetParent instead of calling it twice

* refactor to make code a bit more readable

* add test for the popper without parents

* improved comment

* Simplified condition logic
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