Material: mdInputContainer: cannot submit form using enter key

Created on 26 Jan 2015  路  9Comments  路  Source: angular/material

Please take a look at this fiddle, right now you cannot submit <form> when click Enter key on password field.

For addition, version v0.7.0-rc3-master-1c97333 works fine.

fixed focus

Most helpful comment

You don't always need a submit button.
Angular has an explanation of what's going on with form submission: https://docs.angularjs.org/api/ng/directive/form
(Look under _"Submitting a form and preventing the default action"_.)

All 9 comments

The issue is bigger than that...

Currently _any_ <form> with more than one <input> cannot be submitted using the enter key. Here is an example of the Enter key successfully submitting a form:

http://jsfiddle.net/o8hhbhp7/6/

And here is the same example, only with the addition of a Submit button, which does not have the Enter functionality:

http://jsfiddle.net/o8hhbhp7/7/

Confirming on Chrome, Safari & Firefox.

IE10 console for v0.7.0-master-e4397de:

SCRIPT445: Object doesn't support this action 
angular-material.js, line 1231 character 7

Actually you cannot use form at all now on IE10.

Fixed via e190abefb82ece4a8b5d2335634d9538eaa86388

Can we reopen this? There is still an issue when there is more than one <input>; see this Fiddle:

http://jsfiddle.net/o8hhbhp7/8/

I expect to be able to press enter on either field and it should submit.

You have to have a submit button for the form to submit: http://jsfiddle.net/hh5xh7gf/

You don't always need a submit button.
Angular has an explanation of what's going on with form submission: https://docs.angularjs.org/api/ng/directive/form
(Look under _"Submitting a form and preventing the default action"_.)

Well that sorts my issue out - good to know, and thanks!

:+1:

Was this page helpful?
0 / 5 - 0 ratings