Skip to content

Conversation

RobinMalfait
Copy link
Member

This PR fixes an issue where the Tabs component behaves incorrectly if it is used in a controlled way. If you are controlling the Tabs, then clicking on the tabs should fire the onChange/@change but it should not actually switch tabs, you are in charge of that.

Fixes: #1509

@vercel
Copy link

vercel bot commented Jul 15, 2022

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

Name Status Preview Updated
headlessui-react ✅ Ready (Inspect) Visit Preview Jul 15, 2022 at 2:50PM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview Jul 15, 2022 at 2:50PM (UTC)

When the `Tabs` component is used ina a controlled way, then clicking on
a tab should call the `onChange` callback, but it should not change the
actual tab internally.
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 mode for Tabs component in React does not work
1 participant