@rails/activestorage 7.0.806 → 7.0.1000

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.
package/README.md CHANGED
@@ -145,7 +145,7 @@ Active Storage, with its included JavaScript library, supports uploading directl
145
145
  1. Include the Active Storage JavaScript in your application's JavaScript bundle or reference it directly.
146
146
 
147
147
  Requiring directly without bundling through the asset pipeline in the application html with autostart:
148
- ```html
148
+ ```erb
149
149
  <%= javascript_include_tag "activestorage" %>
150
150
  ```
151
151
  Requiring via importmap-rails without bundling through the asset pipeline in the application html without autostart as ESM:
@@ -767,9 +767,9 @@ function start() {
767
767
  }
768
768
 
769
769
  function didClick(event) {
770
- const {target: target} = event;
771
- if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
772
- submitButtonsByForm.set(target.form, target);
770
+ const button = event.target.closest("button, input");
771
+ if (button && button.type === "submit" && button.form) {
772
+ submitButtonsByForm.set(button.form, button);
773
773
  }
774
774
  }
775
775
 
@@ -750,9 +750,9 @@
750
750
  }
751
751
  }
752
752
  function didClick(event) {
753
- const {target: target} = event;
754
- if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
755
- submitButtonsByForm.set(target.form, target);
753
+ const button = event.target.closest("button, input");
754
+ if (button && button.type === "submit" && button.form) {
755
+ submitButtonsByForm.set(button.form, button);
756
756
  }
757
757
  }
758
758
  function didSubmitForm(event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/activestorage",
3
- "version": "7.0.806",
3
+ "version": "7.0.1000",
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