-
Notifications
You must be signed in to change notification settings - Fork 589
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
[SelectMenu] Broken focus/tab index after selecting #2350
Comments
I'm sorry but I don't understand what the issue is. Would you mind sharing a video maybe? |
select-tab-reset.mp4at 0:04 i am opening the select menu |
You're right, the focus should come back on the button after the menu closes. I'll investigate! |
Not sure I can fix this one, the Combobox is designed to focus the |
Yes, because the search is in the content. Crap. It's probably also difficult to simply refocus the trigger when closing :/ Maybe it's a bit hacky but you could do something with the provides of the root. https://github.com/unovue/radix-vue/blob/main/packages/radix-vue/src/Combobox/ComboboxRoot.vue#L249 If you want I can test a bit and see how it would be possible. Is it already possible to develop nuxt/ui@v3 locally? |
Of course, you just have to checkout the |
So. the I think there are only 2-3 ways to proceed:
(3.) A: I can probably manage to implement it as planned with a few small hacks. I just don't know how strong these hacks are. PoC of the hack <ComboboxRoot v-model:open="open">
<ComboboxAnchor>
<ComboboxInput
as="div"
tabindex="0"
@keydown="open=true"
>My real value</ComboboxInput>
<ComboboxTrigger>
<!-- ... -->
</ComboboxTrigger>
</ComboboxAnchor>
<ComboboxContent>
<WrapperComponent>
<ComboboxInput></ComboboxInput>
</WrapperComponent>
<!-- ... -->
</ComboboxContent>
</ComboboxRoot>
B: Second hack option might be to try refocusing the trigger when an option is selected and fiddeling the rest (keyboard controls (if no search), multiple selection,...) around that. In the long term, it would probably be better to create a feature request in radix-vue and until then probably proceed with option 1 or 3. I can also go into more detail for option 3 about how it could work. I thought i'd just ask you for your opinion before i dive right in. I hope my explanations make sense |
Thanks for the explanation. Not sure I want to start hacking this new version like we did with Headless UI back then. I'm gonna migrate to Once it's done we can submit an issue on Radix Vue to make this work. |
Ahh exciting. Yes, with v2 there's definitely a lot different in terms of keyboard navigation. Apparently, from v2 onwards, the focus for navigation will be directly on the items. As it looks so far, the input component will probably still be the one that gets the focus after the blur. Maybe you could simply ask here with a mini feature request whether you can simply deactivate this with a prop (e.g. |
You can refer shadcn |
Environment
System:
OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 44.48 GB / 62.57 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Browsers:
Chrome: 126.0.6478.126
Version
v3.0.0-alpha.6
Reproduction
https://ui3.nuxt.dev/components/select-menu
Description
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: