From 73825918c00fe286917b0e06a8703e21744f07e7 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Feb 2024 14:02:01 -0600 Subject: [PATCH] fix(web): presenting modal removes the browser's scroll ability (#7257) * fix(web): presenting modal removes the browser's scroll ability * removed unsued code * eslint --- .../lib/components/shared-components/base-modal.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } });