Closed thevipinmishra closed 1 month ago
This is by design. The switch is built on top of the checkbox component which only toggles with the space key or pointer click.
The enter key is reserved for form submissions.
The enter key is reserved for form submissions.
Thanks for the quick response @segunadebayo!
I only mentioned it because it was mentioned in the docs. I think we can remove it then!?
Description
According to the docs, "Switch" toggles on both the "Space" and "Enter" keys.
However, it only works with "Space" and not the other one.
I confirmed it with ark-ui's own Switch component.
Link to Reproduction (or Detailed Explanation)
https://ark-ui.com/react/docs/components/switch
Steps to Reproduce
Vist the "Switch" component page.
Focus on the preview component.
Try toggling it with "Enter" key.
Ark UI Version
4.1.0
Framework
Browser
Google Chrome Dev
Additional Information
No response