Close button sometimes doesn’t work
-
Hello there,
I really like this plugin! It is lightweight, easy to use, and I successfully used it to create a site-wide modal search. However, I noticed a small issue: the close button does not always work correctly. Sometimes the modal remains open even when clicking it repeatedly. I also found the same issue on your demo site, which suggests it might be a bug.
I asked an AI assistant for help, and it provided a temporary CSS workaround that completely fixed the issue:
.wp-block-cloudcatch-light-modal-block__close svg,
.wp-block-cloudcatch-light-modal-block__close svg * {
pointer-events: none;
}The AI noted that this is likely a bug and suggested modifying a specific line in
view.js:e.target.parentNode.classList.contains(this.closeTrigger)To:
e.target.closest(".wp-block-cloudcatch-light-modal-block__close")I tested the change in
view.js, and it worked perfectly—the problem is completely gone. However, modifying the plugin’s core files is not an ideal long-term solution for me, as future updates will overwrite it. I wanted to report this here in hopes that you can include an official fix in the next update.Thank you very much!
Qilin
You must be logged in to reply to this topic.