Skip to content

Commit cbbbe43

Browse files
committed
fix navbar scroll
1 parent 4996045 commit cbbbe43

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/ScrollShadow/ScrollShadow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const ScrollShadow: ParentComponent<
3030
const scrollHorizontally = (e: WheelEvent) => {
3131
if (!isScrollable) return;
3232

33+
e.preventDefault();
3334
const target = e.currentTarget as HTMLElement;
3435
target.scrollLeft += e.deltaX + e.deltaY;
3536
};
@@ -64,7 +65,7 @@ const ScrollShadow: ParentComponent<
6465
init = false;
6566
});
6667

67-
scrollableContainer.addEventListener('wheel', scrollHorizontally, { passive: true });
68+
scrollableContainer.addEventListener('wheel', scrollHorizontally);
6869
sentinelShadowState.set(sentinelFirstEl, { el: shadowFirstEl, visible: false });
6970
sentinelShadowState.set(sentinelLastEl, { el: shadowLastEl, visible: false });
7071
observer.observe(sentinelFirstEl);

0 commit comments

Comments
 (0)