@rails/activestorage 7.1.1 → 7.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -771,9 +771,9 @@ function start() {
771
771
  }
772
772
 
773
773
  function didClick(event) {
774
- const {target: target} = event;
775
- if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
776
- submitButtonsByForm.set(target.form, target);
774
+ const button = event.target.closest("button, input");
775
+ if (button && button.type === "submit" && button.form) {
776
+ submitButtonsByForm.set(button.form, button);
777
777
  }
778
778
  }
779
779
 
@@ -754,9 +754,9 @@
754
754
  }
755
755
  }
756
756
  function didClick(event) {
757
- const {target: target} = event;
758
- if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
759
- submitButtonsByForm.set(target.form, target);
757
+ const button = event.target.closest("button, input");
758
+ if (button && button.type === "submit" && button.form) {
759
+ submitButtonsByForm.set(button.form, button);
760
760
  }
761
761
  }
762
762
  function didSubmitForm(event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/activestorage",
3
- "version": "7.1.1",
3
+ "version": "7.1.3",
4
4
  "description": "Attach cloud and local files in Rails applications",
5
5
  "module": "app/assets/javascripts/activestorage.esm.js",
6
6
  "main": "app/assets/javascripts/activestorage.js",
package/src/ujs.js CHANGED
@@ -15,9 +15,9 @@ export function start() {
15
15
  }
16
16
 
17
17
  function didClick(event) {
18
- const { target } = event
19
- if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
20
- submitButtonsByForm.set(target.form, target)
18
+ const button = event.target.closest("button, input")
19
+ if (button && button.type === "submit" && button.form) {
20
+ submitButtonsByForm.set(button.form, button)
21
21
  }
22
22
  }
23
23