{"action":"created","issue":{"url":"https://api.github.com/repos/PolymerElements/paper-button/issues/69","labels_url":"https://api.github.com/repos/PolymerElements/paper-button/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/PolymerElements/paper-button/issues/69/comments","events_url":"https://api.github.com/repos/PolymerElements/paper-button/issues/69/events","html_url":"https://github.com/PolymerElements/paper-button/issues/69","id":114420483,"number":69,"title":"option for default form submit behaviors","user":{"login":"jab","id":64992,"avatar_url":"https://avatars.githubusercontent.com/u/64992?v=3","gravatar_id":"","url":"https://api.github.com/users/jab","html_url":"https://github.com/jab","followers_url":"https://api.github.com/users/jab/followers","following_url":"https://api.github.com/users/jab/following{/other_user}","gists_url":"https://api.github.com/users/jab/gists{/gist_id}","starred_url":"https://api.github.com/users/jab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jab/subscriptions","organizations_url":"https://api.github.com/users/jab/orgs","repos_url":"https://api.github.com/users/jab/repos","events_url":"https://api.github.com/users/jab/events{/privacy}","received_events_url":"https://api.github.com/users/jab/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-31T16:47:14Z","updated_at":"2016-01-26T22:39:51Z","closed_at":"2016-01-21T19:48:39Z","body":"paper-button does not currently include an actual native button (or `<input type=submit>`) element. As a result, simply including a paper-button inside a form is not sufficient for being able to submit the form by pressing enter from one of the inputs. So currently, hooking this default behavior back up has to be done manually. Similarly, the click handler of a paper-button inside a form must currently be bound to the form's submit manually.\r\n\r\nWhat if users could just write something like:\r\n```html\r\n<form>\r\n  <!-- behavior 1: pressing enter while the cursor is in this input should submit the form -->\r\n  <input name=\"name\" required>\r\n  <!-- behavior 2: clicking this button should submit the form -->\r\n  <paper-button default-submit>\r\n</form>\r\n```\r\nand that `default-submit` attribute would cause the default behaviors above to just work.\r\n\r\nFor behavior 1, it looks like simply including a native `<input type=submit hidden>` anywhere inside the form would do the trick. So could paper-button just add this element to its dom tree when `default-submit` is desired? Then, the paper-button's `onclick` could just call `click()` on the (hidden) native submit input to take care of behavior 2.\r\n\r\nNote, I believe this is orthogonal to (but would nicely complement) PolymerElements/iron-form#46.\r\n\r\nI'd be happy to try to work up a PR if there is interest. What do you think?"},"comment":{"url":"https://api.github.com/repos/PolymerElements/paper-button/issues/comments/175273523","html_url":"https://github.com/PolymerElements/paper-button/issues/69#issuecomment-175273523","issue_url":"https://api.github.com/repos/PolymerElements/paper-button/issues/69","id":175273523,"user":{"login":"elegos","id":577975,"avatar_url":"https://avatars.githubusercontent.com/u/577975?v=3","gravatar_id":"","url":"https://api.github.com/users/elegos","html_url":"https://github.com/elegos","followers_url":"https://api.github.com/users/elegos/followers","following_url":"https://api.github.com/users/elegos/following{/other_user}","gists_url":"https://api.github.com/users/elegos/gists{/gist_id}","starred_url":"https://api.github.com/users/elegos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elegos/subscriptions","organizations_url":"https://api.github.com/users/elegos/orgs","repos_url":"https://api.github.com/users/elegos/repos","events_url":"https://api.github.com/users/elegos/events{/privacy}","received_events_url":"https://api.github.com/users/elegos/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T22:39:51Z","updated_at":"2016-01-26T22:39:51Z","body":"Yep, you're missing that a button has to be re-styled. You can't anticipate which CSS the developer will write for the `button` tag, not only the default styling. I remember in my tests I started out like you embedding the element inside a button, but ended up with that solution due to style problems :)"}}