This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
checkbox: enter should submit form and not toggle #11583
Closed
Description
Bug
CodePen and steps to reproduce the issue:
CodePen Demo which demonstrates the issue:
https://codepen.io/Splaktar/pen/ZVjWRJ?editors=1010#0
Detailed Reproduction Steps:
- Focus the first checkbox (
input type="checkbox"
) and press theEnter
key on the keyboard - Note that the form is submitted and the browser generates a warning for a required field
- Focus the second checkbox (
md-checkbox
) and press theEnter
key on the keyboard - Note that the form is not submitted and the checkbox value is toggled
What is the expected behavior?
Spacebar should toggle checkboxes. Enter should submit the form.
What is the current behavior?
For md-checkbox
, the Enter
key toggles the checkbox.
What is the use-case or motivation for changing an existing behavior?
Consistency with a11y and HTML standards.
Which versions of AngularJS, Material, OS, and browsers are affected?
- AngularJS: 1.7.5
- AngularJS Material: 1.1.12
- OS: macOS
- Browsers: Chrome 71
Is there anything else we should know? Stack Traces, Screenshots, etc.
Thanks to @codymikol for pointing this out.