Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

checkbox: enter should submit form and not toggle #11583

Closed
Splaktar opened this issue Jan 8, 2019 · 1 comment · Fixed by #11584
Closed

checkbox: enter should submit form and not toggle #11583

Splaktar opened this issue Jan 8, 2019 · 1 comment · Fixed by #11584
Assignees
Labels
a11y This issue is related to accessibility has: Pull Request A PR has been created to address this issue P2: required Issues that must be fixed. resolution: fixed type: bug
Milestone

Comments

@Splaktar
Copy link
Member

Splaktar commented Jan 8, 2019

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.

@Splaktar Splaktar self-assigned this Jan 8, 2019
@Splaktar Splaktar added the a11y This issue is related to accessibility label Jan 8, 2019
@Splaktar Splaktar added this to the 1.1.13 milestone Jan 8, 2019
@Splaktar Splaktar removed their assignment Jan 8, 2019
codymikol pushed a commit to codymikol/material that referenced this issue Jan 8, 2019
make enter keypress submit form rather than toggle checkbox

Fixes: angular#11583
codymikol pushed a commit to codymikol/material that referenced this issue Jan 9, 2019
make enter keypress submit form rather than toggle checkbox

Fixes: angular#11583
@codymikol
Copy link
Contributor

@Splaktar this should be good to go 🐔

@Splaktar Splaktar added the has: Pull Request A PR has been created to address this issue label Jan 15, 2019
@Splaktar Splaktar self-assigned this Jan 15, 2019
mmalerba pushed a commit that referenced this issue Feb 1, 2019
make enter keypress submit form rather than toggle checkbox

Fixes: #11583
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility has: Pull Request A PR has been created to address this issue P2: required Issues that must be fixed. resolution: fixed type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants