From a1cbed7e713f476f4cf37c0363ce0bfb38d69260 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 14 Oct 2026 13:53:33 +0400 Subject: [PATCH] refac --- .../components/admin/Functions/FunctionHistory.svelte | 2 +- src/lib/components/common/ConfirmDialog.svelte | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/components/admin/Functions/FunctionHistory.svelte b/src/lib/components/admin/Functions/FunctionHistory.svelte index b224166beb..09a277926d 100644 --- a/src/lib/components/admin/Functions/FunctionHistory.svelte +++ b/src/lib/components/admin/Functions/FunctionHistory.svelte @@ -157,7 +157,7 @@
- + { + if (previousOverflow !== null) { + document.body.style.overflow = previousOverflow; + previousOverflow = null; + } + }; const init = () => { _inputValue = inputValue; @@ -90,6 +97,7 @@ focusTrap.activate(); window.addEventListener('keydown', handleKeyDown); + previousOverflow = document.body.style.overflow; document.body.style.overflow = 'hidden'; } else if (modalElement) { focusTrap.deactivate(); @@ -97,12 +105,13 @@ window.removeEventListener('keydown', handleKeyDown); document.body.removeChild(modalElement); - document.body.style.overflow = 'unset'; + restoreOverflow(); } } onDestroy(() => { show = false; + restoreOverflow(); window.removeEventListener('keydown', handleKeyDown); if (focusTrap) { focusTrap.deactivate();