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

Improve Tabs wrapping around when controlling the component and overflowing the selectedIndex #2213

Merged
merged 4 commits into from
Jan 26, 2023

Conversation

RobinMalfait
Copy link
Member

This PR ensures that underflowing or overflowing the selectedIndex always wraps around so that we
don't end up in a situation where the selectedIndex maps to nothing.

Fixes: #2211

We never want to use and index that doesn't map to a proper tab.

This commit also makes the implementation similar for both React and
Vue.
This is already adjusted when tabs change internally. You can still
manually change it of course, but for these tests that doesn't matter
and cause different results.
@vercel
Copy link

vercel bot commented Jan 26, 2023

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

Name Status Preview Comments Updated
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 26, 2023 at 2:52PM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 26, 2023 at 2:52PM (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.

Controlled Tabs doesn't underflow properly
1 participant