How to close modal by clicking outside of modal?

Hey everyone, I implemented a slide in modal on my website:

I added an animation to close the modal when clicking outside of it, but after this, the website is not scrollable. However, when I close the modal by clicking the X on the top right, the website functions normally.

What’s the issue here? Thank you! Any advice is much appreciated :slight_smile:

Here is my public share link: LINK
(how to access public share link)