From 025a83e58b1e352f4a24a34fb1b964c15be9e98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 31 May 2024 18:55:56 +0000 Subject: [PATCH] Match actiontest sprockets files with the latest changes in Rails 7.2 --- actiontext/app/assets/javascripts/actiontext.esm.js | 6 +++--- actiontext/app/assets/javascripts/actiontext.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actiontext/app/assets/javascripts/actiontext.esm.js b/actiontext/app/assets/javascripts/actiontext.esm.js index 2a3fad67a3..2f433b7f0a 100644 --- a/actiontext/app/assets/javascripts/actiontext.esm.js +++ b/actiontext/app/assets/javascripts/actiontext.esm.js @@ -771,9 +771,9 @@ function start() { } function didClick(event) { - const {target: target} = event; - if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) { - submitButtonsByForm.set(target.form, target); + const button = event.target.closest("button, input"); + if (button && button.type === "submit" && button.form) { + submitButtonsByForm.set(button.form, button); } } diff --git a/actiontext/app/assets/javascripts/actiontext.js b/actiontext/app/assets/javascripts/actiontext.js index a89f5ec3ef..ef283f2757 100644 --- a/actiontext/app/assets/javascripts/actiontext.js +++ b/actiontext/app/assets/javascripts/actiontext.js @@ -753,9 +753,9 @@ } } function didClick(event) { - const {target: target} = event; - if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) { - submitButtonsByForm.set(target.form, target); + const button = event.target.closest("button, input"); + if (button && button.type === "submit" && button.form) { + submitButtonsByForm.set(button.form, button); } } function didSubmitForm(event) {