From 79b61884103516dfabc4943acd2abe3b93600775 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 14 Apr 2024 23:23:05 -0700
Subject: fix(popup): popup blocks scroll on hidde mount

---
 src/lib/Popup.svelte | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/lib/Popup.svelte')

diff --git a/src/lib/Popup.svelte b/src/lib/Popup.svelte
index 7c9949af..be55adf0 100644
--- a/src/lib/Popup.svelte
+++ b/src/lib/Popup.svelte
@@ -1,5 +1,6 @@
 <script lang="ts">
 	import { browser } from '$app/environment';
+	import { onMount } from 'svelte';
 
 	export let onLeave = () => {
 		return;
@@ -19,10 +20,17 @@
 		}
 	};
 
+	onMount(() => {
+		if (browser) document.body.style.overflow = 'auto';
+	});
+
 	$: {
-		if (browser)
+		if (browser) {
+			document.body.style.overflow = 'auto';
+
 			if (show) document.body.style.overflow = 'hidden';
 			else document.body.style.overflow = 'auto';
+		}
 	}
 </script>
 
-- 
cgit v1.2.3

