I really used the search function here, but I am still having one issue with preventing scrolling when a modal is open.
I saw and used this solution here:
It works really fine, on all browsers and mobile, but in this example, two buttons are used to open and then close the modal. But I only have one. On mobile it works, but not on desktop. When I open the modal, I can not scroll (this is what I want) but when I close it, I want to be able to scroll again (and this does not work). Someone already asked for creating this and the answer was adding “.w–open” which Webflow creates for the second trigger. I tried it and it does not work, neither when I put the code on the page or in custom code in the settings.
Does anyone know how to fix this?
Here is a read only link, I know, custom code does not work in preview mode. I just cloned the link above and deleted the close button:
Here the published link:
Thanks in advance!