Skip to content

Commit

Permalink
don't trigger drag scroll on article content when it is in fully in v…
Browse files Browse the repository at this point in the history
…iew.
  • Loading branch information
fiatjaf committed Sep 17, 2023
1 parent cf47720 commit 7da1485
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { tabs } from '$lib/state';
import TabElement from '$components/TabElement.svelte';
import Searchbar from '$components/Searchbar.svelte';
import { scrollTabIntoView } from '$lib/utils';
import { isElementInViewport, scrollTabIntoView } from '$lib/utils';
import '../app.postcss';
import { onMount } from 'svelte';
Expand All @@ -28,7 +28,10 @@
if (
ev.target instanceof HTMLInputElement ||
ev.target instanceof HTMLTextAreaElement ||
ev.target instanceof HTMLButtonElement
ev.target instanceof HTMLButtonElement ||
(ev.target instanceof HTMLElement &&
ev.target.parentElement?.classList.contains('prose') &&
isElementInViewport(ev.target.parentNode as HTMLElement))
)
return;
Expand Down

0 comments on commit 7da1485

Please sign in to comment.