Skip to content

Commit

Permalink
fix(+layout): disable mobile browsers to pull-to-refresh functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 committed Nov 13, 2024
1 parent bf7dda2 commit 7ad7eff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/mapper/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@
setBasePath('/mapnow');
let { data, children } = $props();
document.addEventListener(
'touchstart',
(e) => {
if (window.scrollY === 0) {
e.preventDefault(); // Prevents mobile browsers from pull-to-refresh
}
},
{ passive: false },
);
</script>

<main class="flex flex-col h-screen overflow-hidden">
<hot-header></hot-header>
<Toast />
{@render children?.({ data, })}
{@render children?.({ data })}
</main>

0 comments on commit 7ad7eff

Please sign in to comment.