From 9e79518e845bc8c571dacd8da2ed2100f894d9fe Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Sat, 11 Feb 2023 17:38:09 -0500 Subject: [PATCH] [O] Prevent scroll event propagation --- README.md | 1 + src/App.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 0ae5341..e53c7b1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ A cute, feature-rich file listing module to replace nginx's autoindex / fancyind * [x] List files * [x] Show file icons +* [x] Clickable, length-safe breadcrumb path **TODO** diff --git a/src/App.tsx b/src/App.tsx index f8d8b05..81b1ff6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -57,6 +57,9 @@ export default function App() { // Handle wheel for breadcrumb function wheel(e: WheelEvent) { + e.preventDefault() + e.stopPropagation() + let direction = (e.detail < 0 || e.deltaY > 0) ? 1 : -1 setBcLeft(clamp(bcLeft() + direction * 20, 0, bcMax)) }