Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 7d6145f

Browse files
authored
feat: constrain mousedown to left clicks
Only respond to mouse main button clicks (usually the left button). https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button close #277
1 parent 3b48de8 commit 7d6145f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rangeslider.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@
316316

317317
Plugin.prototype.handleDown = function(e) {
318318
e.preventDefault();
319+
320+
// Only respond to mouse main button clicks (usually the left button)
321+
if (e.button && e.button !== 0) return;
322+
319323
this.$document.on(this.moveEvent, this.handleMove);
320324
this.$document.on(this.endEvent, this.handleEnd);
321325

0 commit comments

Comments
 (0)