-
Notifications
You must be signed in to change notification settings - Fork 211
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
fix(radio-group): onChange event not triggering on keyboard navigation #3592
Conversation
Tachometer resultsChromeradio permalink
Firefoxradio permalink
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get a test in Radio Group for this fix?
I don't know if we've explicitly discussed this, but it's best practise to write a test when making bug fixes so that we know it's actually fixed and can make sure other additions to the code don't cause our tests to fail. The best way to test this is to write the test before making changes (it will fail), make the change, and watch the test succeed!
the test I'd recommend for this is it("emits change events on arrow key events")
. You can use the sinon/spy
package to check the callCount of the change event to make sure it emits as expected.
Let me know if you have more questions!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you
#3592) * fix(radio): onchange trigger * test: added test for change events on arrow key events --------- Co-authored-by: Rajdeep Chandra <[email protected]>
#3592) * fix(radio): onchange trigger * test: added test for change events on arrow key events --------- Co-authored-by: Rajdeep Chandra <[email protected]>
Description
Added onChange trigger when radio buttons are navigated via keyboard in a radio-group
Related issue(s)
Motivation and context
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.