Skip to content

Commit

Permalink
fix($range): Fix issue with overlapping points (#320)
Browse files Browse the repository at this point in the history
Bug when trying to move overlapping points

#286
  • Loading branch information
jeznag authored and paranoidjk committed Sep 15, 2017
1 parent 722ddd2 commit 0a07ada
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/marks.js
Expand Up @@ -45,7 +45,7 @@ ReactDOM.render(

<div style={style}>
<p>Range with marks</p>
<Slider.Range min={-10} marks={marks} onChange={log} defaultValue={[20, 40]} />
<Slider.Range min={-10} marks={marks} onChange={log} defaultValue={[20, 25, 30, 40]} />
</div>
<div style={style}>
<p>Range with marks and steps</p>
Expand Down
3 changes: 2 additions & 1 deletion src/Range.jsx
Expand Up @@ -161,7 +161,8 @@ class Range extends React.Component {
const { bounds, recent } = this.state;
let boundNeedMoving = closestBound;
const isAtTheSamePoint = (bounds[closestBound + 1] === bounds[closestBound]);
if (isAtTheSamePoint) {

if (isAtTheSamePoint && bounds[recent] === bounds[closestBound]) {
boundNeedMoving = recent;
}

Expand Down

0 comments on commit 0a07ada

Please sign in to comment.