How to se-set/scroll to top of modal content when modal is opened

Hi everyone,

I have a small 1-page non-CMS website and use a interaction to open articles in popup modals. All works well, with body prevented from scrolling while a modal is open.

Now, when a user scrolls down the content of a modal, closes it and re-opens it later, it opens at the same position they scrolled to previously. However, I need this to be re-set so that when the user opens the modal a second time, it opens at the start of the content, so scrolled back to the top.

Unfortunately, I have no idea how to achieve this and would be grateful if anyone could suggest any custom code or setup to make this possible.

Thank you!

Hello Spirelli,

Hope you’re well. Did you ever find a solution to this issue? I’m have the same problem with my modals not re-setting.

I would also love to know how you prevented the body of your page to not scroll while the modal is open if you could share that as well :slight_smile:

Any help is greatly appreciated!