Skip to content

Commit

Permalink
fix: do nothing when right clicking on the slider
Browse files Browse the repository at this point in the history
Previously right click would behave the same as left click and
would cause some strange behavior.
  • Loading branch information
Brian Stone authored and stonebk committed Sep 27, 2019
1 parent f05c7b1 commit 9fa9eb4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/ReactSlider/ReactSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ class ReactSlider extends React.Component {
};

onSliderMouseDown = e => {
if (this.props.disabled) {
// do nothing if disabled or right click
if (this.props.disabled || e.button === 2) {
return;
}
this.hasMoved = false;
Expand Down Expand Up @@ -532,7 +533,8 @@ class ReactSlider extends React.Component {

// create the `mousedown` handler for the i-th thumb
createOnMouseDown = i => e => {
if (this.props.disabled) {
// do nothing if disabled or right click
if (this.props.disabled || e.button === 2) {
return;
}
const position = this.getMousePosition(e);
Expand Down

0 comments on commit 9fa9eb4

Please sign in to comment.