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

Radio inputs - using Arrow keys to navigate focuses incorrect inputs #1048

Open
vgpena opened this issue Aug 31, 2022 · 1 comment · May be fixed by #1049 or #1138
Open

Radio inputs - using Arrow keys to navigate focuses incorrect inputs #1048

vgpena opened this issue Aug 31, 2022 · 1 comment · May be fixed by #1049 or #1138
Labels
bug Something isn't working

Comments

@vgpena
Copy link

vgpena commented Aug 31, 2022

Reproduction example

https://codesandbox.io/s/ancient-forest-44xrzm?file=/src/App.js

Prerequisites

Render a group of at least 3 radio inputs that:

  • share the same name attribute
  • can be navigated to using the keyboard (i.e., are not disabled)

Expected behavior

Codesandbox test: https://codesandbox.io/s/ancient-forest-44xrzm?file=/src/App.test.js

Keyboard user events should follow the patterns outlined here.

Specifically, ArrowRight and ArrowDown should advance the focus within the radio group, wrapping back to the beginning if needed. ArrowLeft and ArrowUp should reverse the focus within the group, wrapping back to the end if needed.

Actual behavior

Arrow keys send focus to the wrong input in the Radio Group. E.g.,ArrowRight send focus through all the inputs to the last input in the group.

User-event version

14.4.3

Environment

Bug is reproducible in CodeSandbox, so skipping this section.

Testing Library framework:

JS framework:

Test environment:

DOM implementation:

Additional context

Radio group arrow functionality was added here - #995

@vgpena vgpena added bug Something isn't working needs assessment This needs to be looked at by a team member labels Aug 31, 2022
@vgpena vgpena linked a pull request Aug 31, 2022 that will close this issue
3 tasks
@ph-fritsche
Copy link
Member

Thanks for the report ❤️

@ph-fritsche ph-fritsche removed the needs assessment This needs to be looked at by a team member label Sep 1, 2022
@ph-fritsche ph-fritsche linked a pull request Sep 14, 2022 that will close this issue
3 tasks
@tnyo43 tnyo43 linked a pull request May 25, 2023 that will close this issue
2 tasks
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
2 participants