fix: delegate checkbox/radio/switch label keydown to native inputs#9972
fix: delegate checkbox/radio/switch label keydown to native inputs#9972nami8824 wants to merge 5 commits into
Conversation
snowystinger
left a comment
There was a problem hiding this comment.
One big thing to note, Enter can no longer be used to toggle a switch or checkbox with this PR. It could be argued that Space should be the only way to do it as that is how native inputs work, but we've had this behaviour for 6+ years, so I don't know if we can change it lightly.
I hadn't noticed this impact. I think disabling Enter-to-toggle is necessary to properly address this issue, because allowing Enter to both toggle a checkbox/radio/switch and submit a form at the same time feels like unexpected behavior. How should Enter be handled for these elements...? |
|
Nothing yet, lets wait for more opinions from the team |
Closes #6235
usePress'sonKeyDownwas preventing default on 'Enter' key for input's of type radio and checkbox✅ Pull Request Checklist:
📝 Test Instructions:
Go to a form with a radio/checkbox/switch and the ability to implicitly submit, fill out the form and hit Enter from one of those three components.
🧢 Your Project: