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

feat: Get elements ownerDocument for correct measurements #607

Merged

Conversation

ryanseddon
Copy link

After some digging I found that when getWindowSizes is called it looks at the parent document which get incorrect values when using this inside of an iframe.

I created a test case here: https://codesandbox.io/s/8n31m5132j

First one is in an iframe and always puts it at the bottom even though it doesn't have enough room.

The second one shows the same thing but not wrapped in a iframe. This correctly moved the popper to the top of the element and upon scrolling moves it to the bottom.

@FezVrasta FezVrasta merged commit a906323 into floating-ui:master Apr 11, 2018
@FezVrasta
Copy link
Member

Thanks!

@ryanseddon ryanseddon deleted the ryan/ownerDocument_getWindowSizes branch April 12, 2018 00:43
@ryanseddon
Copy link
Author

Will you push out a react-popper update soon with this change?

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

Successfully merging this pull request may close these issues.

None yet

2 participants