Skip to content
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
@Splaktar

Description

@Splaktar

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:

  1. Focus the first checkbox (input type="checkbox") and press the Enter key on the keyboard
  2. Note that the form is submitted and the browser generates a warning for a required field
  3. Focus the second checkbox (md-checkbox) and press the Enter key on the keyboard
  4. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions