-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Focused radio buttons don't submit form on Enter #577
Comments
Confirmed this behavior: http://codepen.io/marcysutton/pen/GgqQqQ |
I think there is still a problem with md-radio-groups and form submission. When there is no ng-submit handler configured directly on the form but there is a button with type=submit then the angular specification says that the click handler of the first type="submit" button should be triggered when pressing enter (see https://docs.angularjs.org/api/ng/directive/form section "Submitting a form and preventing the default action"). This works for normal input elements but not for md-radio-buttons. JS Fiddle to demonstrate the issue:
Maybe this issue could be reopend? I think in radioButton.js the keydownListener() function should be appended by something along the following lines in the KEY_DOWN_ENTER case. |
To reproduce:
Construct a
<form>
withmd-radio-group
any positive number ofmd-radio-button
elements and a submit button.Use the keyboard to focus the radio button group.
Press Enter.
Notice that the submit button is not activated.
Expected result:
The submit button should be activated.
Rationale:
Typical user agent behavior for forms is that pressing Enter while focused on a form element triggers an "implicit" submit (activate the submit button, if one is available). This is the behavior of the native control in Firefox and Chrome. http://www.w3.org/TR/html5/forms.html#implicit-submission
The text was updated successfully, but these errors were encountered: