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.
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.
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: https://github.com/testing-library/user-event/issues/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: