{"action":"created","issue":{"url":"https://api.github.com/repos/PolymerElements/iron-form/issues/150","repository_url":"https://api.github.com/repos/PolymerElements/iron-form","labels_url":"https://api.github.com/repos/PolymerElements/iron-form/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/PolymerElements/iron-form/issues/150/comments","events_url":"https://api.github.com/repos/PolymerElements/iron-form/issues/150/events","html_url":"https://github.com/PolymerElements/iron-form/issues/150","id":173579544,"number":150,"title":"Pressing Enter Will Not Submit Forms with More than 1 Input","user":{"login":"tzyhhaur","id":14350517,"avatar_url":"https://avatars.githubusercontent.com/u/14350517?v=3","gravatar_id":"","url":"https://api.github.com/users/tzyhhaur","html_url":"https://github.com/tzyhhaur","followers_url":"https://api.github.com/users/tzyhhaur/followers","following_url":"https://api.github.com/users/tzyhhaur/following{/other_user}","gists_url":"https://api.github.com/users/tzyhhaur/gists{/gist_id}","starred_url":"https://api.github.com/users/tzyhhaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzyhhaur/subscriptions","organizations_url":"https://api.github.com/users/tzyhhaur/orgs","repos_url":"https://api.github.com/users/tzyhhaur/repos","events_url":"https://api.github.com/users/tzyhhaur/events{/privacy}","received_events_url":"https://api.github.com/users/tzyhhaur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-27T05:35:57Z","updated_at":"2016-09-01T14:56:19Z","closed_at":null,"body":"Taking the demo code at https://elements.polymer-project.org/elements/iron-form?view=demo:demo/index.html&active=iron-form as example. The following code works well when I press enter on the input.\r\n```html\r\n<form is=\"iron-form\" method=\"get\" action=\"/\" id=\"presubmit\">\r\n  <paper-input name=\"name\" label=\"Name\" value=\"Batman\" required></paper-input>\r\n  <paper-button raised onclick=\"_submit(event)\">Submit</paper-button>\r\n  <paper-button raised onclick=\"_reset(event)\">Reset</paper-button>\r\n  <div class=\"output\"></div>\r\n</form>\r\n<script>\r\n  function _submit(event) {\r\n    Polymer.dom(event).localTarget.parentElement.submit();\r\n  }\r\n  function _reset(event) {\r\n    var form = Polymer.dom(event).localTarget.parentElement\r\n    form.reset();\r\n    form.querySelector('.output').innerHTML = '';\r\n  }\r\n  presubmit.addEventListener('iron-form-presubmit', function(event) {\r\n    this.request.params['sidekick'] = 'Robin';\r\n  });\r\n  presubmit.addEventListener('iron-form-submit', function(event) {\r\n    this.querySelector('.output').innerHTML = JSON.stringify(event.detail);\r\n  });\r\n</script>\r\n```\r\n\r\nHowever, suppose I add another paper-input DOM, as followed, pressing enter key (on either input) would not trigger the iron-form-submit event anymore. Tested this on Safari and Chrome.\r\n\r\n```html\r\n<form is=\"iron-form\" method=\"get\" action=\"/\" id=\"presubmit\">\r\n  <paper-input></paper-input>\r\n  <paper-input name=\"name\" label=\"Name\" value=\"Batman\" required></paper-input>\r\n  <paper-button raised onclick=\"_submit(event)\">Submit</paper-button>\r\n  <paper-button raised onclick=\"_reset(event)\">Reset</paper-button>\r\n  <div class=\"output\"></div>\r\n</form>\r\n```"},"comment":{"url":"https://api.github.com/repos/PolymerElements/iron-form/issues/comments/244105432","html_url":"https://github.com/PolymerElements/iron-form/issues/150#issuecomment-244105432","issue_url":"https://api.github.com/repos/PolymerElements/iron-form/issues/150","id":244105432,"user":{"login":"cgriffin4","id":455086,"avatar_url":"https://avatars.githubusercontent.com/u/455086?v=3","gravatar_id":"","url":"https://api.github.com/users/cgriffin4","html_url":"https://github.com/cgriffin4","followers_url":"https://api.github.com/users/cgriffin4/followers","following_url":"https://api.github.com/users/cgriffin4/following{/other_user}","gists_url":"https://api.github.com/users/cgriffin4/gists{/gist_id}","starred_url":"https://api.github.com/users/cgriffin4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgriffin4/subscriptions","organizations_url":"https://api.github.com/users/cgriffin4/orgs","repos_url":"https://api.github.com/users/cgriffin4/repos","events_url":"https://api.github.com/users/cgriffin4/events{/privacy}","received_events_url":"https://api.github.com/users/cgriffin4/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T14:56:19Z","updated_at":"2016-09-01T14:56:19Z","body":"To make your example work you'll need to have a button with the type of submit in the form. The submit on enter behavior is native form behavior for the browser and is only triggered if there is a submit button. The visibility of the button is not considered so an acceptable \"workaround\" is to include a hidden submit button. I'd have to look at the demo more closely to see why it DOES work. \r\n\r\nFurther information can be found in issue #32 \r\n\r\nAs a side note. Worrisome you haven't received a response to this earlier."}}
{"actor":{"display_login":"cgriffin4"}}