diff --git a/assets/js/dismiss-notices.js b/assets/js/dismiss-notices.js index ca3de72..a5b0ca7 100644 --- a/assets/js/dismiss-notices.js +++ b/assets/js/dismiss-notices.js @@ -61,9 +61,13 @@ const addEventListeners = (el) => { // Handle notification close/dismiss events - const closeButton = el.querySelector('[data-action="close"]'); - if (closeButton) { - closeButton.addEventListener('click', dismissNotice); + const closeButtons = Array.from(el.querySelectorAll('[data-action="close"]')); + if (closeButtons.length) { + closeButtons.forEach( + closeButton => { + closeButton.addEventListener('click', dismissNotice); + } + ) } // Handle notification button click event tracking