Button Click event calling twice #2085
-
I have a use case where I have to wrap checkbox with button.
Code sandbox: https://codesandbox.io/embed/admiring-hugle-pmzzu?fontsize=14&hidenavigation=1&theme=dark |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
From an accessibility perspective, a checkbox should not be nested within a button as you can't nest focusable HTML elements. In the HTML spec, it highlights that permitted content in a Button includes "Phrasing content but there must be no Interactive content". Could you share more about your use case? Happy to discuss possible accessible options to the interaction you're looking for. |
Beta Was this translation helpful? Give feedback.
-
Hi @vignesh-sivaprakasam 👋 Do you have what you need or would you like more assistance with this? |
Beta Was this translation helpful? Give feedback.
Hi @vignesh-sivaprakasam!
From an accessibility perspective, a checkbox should not be nested within a button as you can't nest focusable HTML elements. In the HTML spec, it highlights that permitted content in a Button includes "Phrasing content but there must be no Interactive content".
Could you share more about your use case? Happy to discuss possible accessible options to the interaction you're looking for.