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

Trigger scrollIntoView effect when position changes #1113

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

RobinMalfait
Copy link
Member

This PR will fix an issue that the current active item could be invisible (scrolled out of the viewport).
This mainly happens if you add a bunch of items before the active one so that the active one gets pushed down and eventually becomes invisible.
To fix this, we will also make sure to trigger the effect if the position of the active item changes.

This is important otherwise it could happen that the current active item
is still the active item even if we inserted X items before the current
one. This will result in the active item being out of the current
viewport. To fix this, we will also make sure to trigger the effect if
the position of the active item changes.
@vercel
Copy link

vercel bot commented Feb 17, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-vue – ./packages/playground-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/7fjK4cxLJX5onwJPAhDH6dA9oCHj
✅ Preview: https://headlessui-vue-git-fix-offscreen-active-item-tailwindlabs.vercel.app

headlessui-react – ./packages/playground-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/FVAgufZavR68G9roNAV685P5jYfW
✅ Preview: https://headlessui-react-git-fix-offscreen-active-item-tailwindlabs.vercel.app

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.

1 participant