Title: Close button sometimes doesn&#8217;t work
Last modified: July 11, 2026

---

# Close button sometimes doesn’t work

 *  [Qilin](https://wordpress.org/support/users/qilin2000/)
 * (@qilin2000)
 * [3 days, 6 hours ago](https://wordpress.org/support/topic/close-button-sometimes-doesnt-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-code
       .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`:
 *     ```wp-block-code
       e.target.parentNode.classList.contains(this.closeTrigger)
       ```
   
 * To:
 *     ```wp-block-code
       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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fclose-button-sometimes-doesnt-work%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/light-modal-block/assets/icon.svg?rev=3399001)
 * [Light Modal Block](https://wordpress.org/plugins/light-modal-block/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/light-modal-block/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/light-modal-block/)
 * [Active Topics](https://wordpress.org/support/plugin/light-modal-block/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/light-modal-block/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/light-modal-block/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Qilin](https://wordpress.org/support/users/qilin2000/)
 * Last activity: [3 days, 6 hours ago](https://wordpress.org/support/topic/close-button-sometimes-doesnt-work/)
 * Status: not resolved