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

Stop scrolling when hitting end of focus trap #1789

Merged
merged 5 commits into from Aug 26, 2022

Conversation

thecrypticace
Copy link
Contributor

I think this fix could work. Basically the problem is that in Chrome and FF, depending on the markup, the inferred position of the absolute positioned is at the bottom of the document rather than viewport of the dialog. It seems that we can move both to the top-left of the document (or relative container more specifically) and it doesn't affect tabbing before/after behavior and prevents the scroll.

I don't believe this is testable in JSDOM.

Fixes #1787

@vercel
Copy link

vercel bot commented Aug 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
headlessui-react ✅ Ready (Inspect) Visit Preview Aug 26, 2022 at 1:16PM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview Aug 26, 2022 at 1:16PM (UTC)

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.

Dialog scrolls page body to bottom when focus trap loops back to first element
1 participant