Skip to content

Commit

Permalink
fix(selectable): prevent right-click from triggering selection
Browse files Browse the repository at this point in the history
  • Loading branch information
pcdotfan authored Oct 16, 2024
1 parent 1f3aadf commit a4b53eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Selectable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ function Selectable<T>(
};

const onMouseDown = (e: MouseEvent | TouchEvent) => {
if (e instanceof MouseEvent && e.button !== 0) {
return;
}

// disable text selection, but it will prevent default scroll behavior when mouse move, so we used `useScroll`
e.preventDefault();
isMouseDowning = true;
Expand Down

0 comments on commit a4b53eb

Please sign in to comment.