Skip to content

Commit 4c4957d

Browse files
authored
Ignore right-click in row navigation handler (#18)
auxclick fires for the right button too, so right-clicking row whitespace navigated the page underneath the context menu. Bail unless it's the primary or middle button.
1 parent 3e1dcf9 commit 4c4957d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/pages/index.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ const transitionName = (part: string, value: string) =>
222222
// landed on the last row (all routed to one domain). This has no layout
223223
// dependency, so that failure mode can't recur.
224224
const rowNav = (e: MouseEvent) => {
225+
if (e.button !== 0 && e.button !== 1) return; // auxclick also fires for right-click
225226
const t = e.target as HTMLElement;
226227
if (t.closest("a, button")) return; // real links/buttons handle themselves
227228
const link = t.closest("tr")?.querySelector<HTMLAnchorElement>(".c-name a");

0 commit comments

Comments
 (0)