Skip to content

Commit

Permalink
BREAKING CHANGE: only fire slider position change on left mouse click…
Browse files Browse the repository at this point in the history
… (or standard touch event) closes #92
  • Loading branch information
nerdyman committed Jan 5, 2023
1 parent caafd1a commit 04f24e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ReactCompareSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ export const ReactCompareSlider: FC<ReactCompareSliderDetailedProps> = ({
(ev: PointerEvent) => {
ev.preventDefault();

// Only handle left mouse button (touch events also use 0).
if (ev.button !== 0) return;

updateInternalPosition({
portrait,
boundsPadding,
Expand Down

0 comments on commit 04f24e3

Please sign in to comment.