Skip to content

Fix radio keyboard events#1199

Closed
joshferrell wants to merge 3 commits intotesting-library:mainfrom
joshferrell:jferrell/fix-radio-events
Closed

Fix radio keyboard events#1199
joshferrell wants to merge 3 commits intotesting-library:mainfrom
joshferrell:jferrell/fix-radio-events

Conversation

@joshferrell
Copy link
Copy Markdown
Contributor

What:
There is currently an issue with the behavior of radio inputs and the user-event library. Because the walkRadio method does not break out of the loop when iterating through options, it can sometimes skip over the correct option.

There's also an issue where the direction that the arrow up and arrow down keys were swapped. Arrow down should increment and arrow up should decrement.

Fixes issue: #1198

Why:

There was an issue with the robustness of the tests where going through the radio options, only A and D were possible. So the tests were just flipping between the only two available radio options. Adding an additional radio input breaks the tests.

How:

I've updated the tests to include an additional radio input to ensure that behavior is correct. I've also added an additional tests to ensure that radio inputs behave correctly for aria-disabled as they should still be focusable. This matches the browser behavior.

Checklist:

  • [N/A] Documentation
  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@joshferrell joshferrell changed the title Fix radio events Fix radio keyboard events Feb 27, 2024
@ph-fritsche
Copy link
Copy Markdown
Member

resolved by #1049

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.

3 participants