diff --git a/app/javascript/alchemy_admin/utils/events.js b/app/javascript/alchemy_admin/utils/events.js index 933d8d5b85..8d085ae993 100644 --- a/app/javascript/alchemy_admin/utils/events.js +++ b/app/javascript/alchemy_admin/utils/events.js @@ -1,8 +1,7 @@ export function on(eventName, baseSelector, targetSelector, callback) { document.querySelectorAll(baseSelector).forEach((baseNode) => { - const targets = Array.from(baseNode.querySelectorAll(targetSelector)) - baseNode.addEventListener(eventName, (evt) => { + const targets = Array.from(baseNode.querySelectorAll(targetSelector)) let currentNode = evt.target while (currentNode !== baseNode) {