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

Conditional render breaks focus order #1015

Closed
Solant opened this issue Jan 3, 2022 · 1 comment
Closed

Conditional render breaks focus order #1015

Solant opened this issue Jan 3, 2022 · 1 comment
Assignees

Comments

@Solant
Copy link

Solant commented Jan 3, 2022

What package within Headless UI are you using?

For example: @headlessui/vue

What version of that package are you using?

For example: 1.4.2

What browser are you using?

For example: Chrome 96

Reproduction URL

https://codesandbox.io/s/focus-order-issue-g4tkc?file=/src/App.vue

Describe your issue

Toggle checkbox twice and then try to change the current tab with arrow keys. Newly rendered Tab 2 will be focused after Tab 3. This can be related to calling tabs.value.push() on <Tab /> render
( https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-vue/src/components/tabs/tabs.ts#L81 )

@Solant Solant changed the title Conditional rendering breaks focus order Conditional render breaks focus order Jan 3, 2022
@RobinMalfait RobinMalfait self-assigned this Jan 14, 2022
@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed, and will be available in the next release.

You can already try it by using the insiders build npm install @headlessui/vue@dev or yarn add @headlessui/vue@dev.

Here is an updated codesandbox link with the bumped version: https://codesandbox.io/s/focus-order-issue-forked-gv0qq

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

No branches or pull requests

2 participants