Skip to content

Commit

Permalink
Fix button.type = 'submit' and support button.type = 'reset' - Fix as…
Browse files Browse the repository at this point in the history
  • Loading branch information
arturog committed Aug 26, 2019
1 parent 991ad55 commit 283a7f2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/dom/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,19 @@ DOM.HTMLButtonElement.prototype._click = function(event) {
if (button.getAttribute('disabled'))
return false;

const buttonType = button.getAttribute('type');
if (buttonType === 'button')
return;

const form = button.form;
if (form)
if (form) {
if (buttonType === 'reset') {
input.form.reset();
return;
}

return form._dispatchSubmitEvent(button);
}
};

DOM.HTMLInputElement.prototype._click = function(event) {
Expand Down

0 comments on commit 283a7f2

Please sign in to comment.