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

[Bug]: Radio Group has disappearing focus #1264

Closed
hrubysi opened this issue Sep 3, 2024 · 12 comments · Fixed by #1268
Closed

[Bug]: Radio Group has disappearing focus #1264

hrubysi opened this issue Sep 3, 2024 · 12 comments · Fixed by #1268
Assignees
Labels
bug Something isn't working

Comments

@hrubysi
Copy link

hrubysi commented Sep 3, 2024

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: [email protected]
Radix Vue version: 1.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: [email protected]
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://www.radix-vue.com/components/radio-group#radiogroup

Steps to reproduce

  1. Click any options of Radio Group
  2. Click outside
  3. Tab

Describe the bug

Radio Group can make focus disappear when choice is first selected by mouse and then user uses tab to move around the form.
The focus goes to the wrapper div[role="radiogroup"] instead of some of the options.

Expected behavior

Focus doesn't disappear.
Focus goes directly to some of the options instead of the wrapper div.

Context & Screenshots (if applicable)

No response

@hrubysi hrubysi added the bug Something isn't working label Sep 3, 2024
@zernonia
Copy link
Member

zernonia commented Sep 3, 2024

@hrubysi can you provide a better reproduction? the focus looks fine for me

@zernonia zernonia added the need-reproduction Issue is lacking reproduction. Will be close if not provided. label Sep 3, 2024
@hrubysimon
Copy link

@zernonia
Copy link
Member

zernonia commented Sep 3, 2024

Thanks @hrubysimon , but is it happening too on Stackblitz? Might be browser issue. Could you perhaps try other browser?

@hrubysimon
Copy link

hrubysimon commented Sep 3, 2024

@zernonia It happens on Brave, Chrome, Edge.
Only browser where it worked for me is Firefox.

I found about it in my project, so it's not just related to radix-vue.com

@zernonia
Copy link
Member

zernonia commented Sep 3, 2024

Icic.. It's kinda weird.. Can you try it here and see? https://react-spectrum.adobe.com/react-aria/RadioGroup.html#radiogroup

@hrubysimon
Copy link

hrubysimon commented Sep 3, 2024

That works fine. Stackblitz is same as radix-vue.com

@zernonia
Copy link
Member

zernonia commented Sep 3, 2024

Icic. Lastly, can you check https://www.radix-ui.com/primitives/docs/components/radio-group ? The current project is referencing from the main Radix UI repo

@hrubysimon
Copy link

That also works well.

@zernonia
Copy link
Member

zernonia commented Sep 3, 2024

Ok that's weird. I'll dig deeper soon 🤞🏻 Thanks for reporting this

@hrubysimon
Copy link

hrubysimon commented Sep 3, 2024

It seems to me, that it might be caused by isClickFocus.value which is probably true after clicking with mouse, then the focus handler is skipped because of it and then it's set to false again.

https://github.com/radix-vue/radix-vue/blob/main/packages/radix-vue/src/RovingFocus/RovingFocusGroup.vue#L106

@hrubysimon
Copy link

Confirmed by console log. Not sure about the safari bug, so I'm going to leave it up to you.

@zernonia
Copy link
Member

zernonia commented Sep 4, 2024

Appreciate the insight @hrubysimon !! I think I manage to trace the issue and the same is happening on Radix UI lol

image

@zernonia zernonia self-assigned this Sep 4, 2024
@zernonia zernonia removed the need-reproduction Issue is lacking reproduction. Will be close if not provided. label Sep 4, 2024
@zernonia zernonia linked a pull request Sep 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants