diff options
author | Tasos Maschalidis <tas.o.s@hotmail.com> | 2018-11-24 21:54:05 +0200 |
---|---|---|
committer | George Claghorn <george.claghorn@gmail.com> | 2018-11-24 14:54:05 -0500 |
commit | d6fcc419fe4f99d3f9414d39d081bd6355842018 (patch) | |
tree | d2de1b95ad5ef5548bfc37077eb1173dc20167de /activestorage/app/javascript | |
parent | f3a79e6aa5da48ac3e4d2fbedf44cb7b58f2a379 (diff) | |
download | rails-d6fcc419fe4f99d3f9414d39d081bd6355842018.tar.gz rails-d6fcc419fe4f99d3f9414d39d081bd6355842018.tar.bz2 rails-d6fcc419fe4f99d3f9414d39d081bd6355842018.zip |
ASt direct uploads: account for <button type="submit"> elements
Diffstat (limited to 'activestorage/app/javascript')
-rw-r--r-- | activestorage/app/javascript/activestorage/ujs.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/app/javascript/activestorage/ujs.js b/activestorage/app/javascript/activestorage/ujs.js index f5353389ef..98fcba60fa 100644 --- a/activestorage/app/javascript/activestorage/ujs.js +++ b/activestorage/app/javascript/activestorage/ujs.js @@ -16,7 +16,7 @@ export function start() { function didClick(event) { const { target } = event - if (target.tagName == "INPUT" && target.type == "submit" && target.form) { + if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) { submitButtonsByForm.set(target.form, target) } } @@ -58,7 +58,7 @@ function handleFormSubmissionEvent(event) { } function submitForm(form) { - let button = submitButtonsByForm.get(form) || findElement(form, "input[type=submit]") + let button = submitButtonsByForm.get(form) || findElement(form, "input[type=submit], button[type=submit]") if (button) { const { disabled } = button |