diff --git a/web/src/lib/components/shared-components/base-modal.svelte b/web/src/lib/components/shared-components/base-modal.svelte index 09d22646ca..f7dd30980c 100644 --- a/web/src/lib/components/shared-components/base-modal.svelte +++ b/web/src/lib/components/shared-components/base-modal.svelte @@ -18,15 +18,18 @@ if (browser) { const scrollTop = document.documentElement.scrollTop; const scrollLeft = document.documentElement.scrollLeft; - window.addEventListener('scroll', function () { + + /* eslint-disable unicorn/prefer-add-event-listener */ + window.onscroll = function () { window.scrollTo(scrollLeft, scrollTop); - }); + }; } }); onDestroy(() => { if (browser) { - window.addEventListener('scroll', () => {}); + /* eslint-disable unicorn/prefer-add-event-listener */ + window.onscroll = null; } });