-
-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ranges with allowCross=false result in wrong handle moving when dragging #226
Comments
Could you provide re-producible online demo? And some steps to re-produce it. Thanks. |
I could put one up on codepen for instance, but I couldn't figure out how to add rc-slider as an external resource there. |
Please provide a re-producible demo: http://codepen.io/benjycui/pen/aJooRE?editors=0011 |
Thanks a lot for the help! Been a busy week so I didn't find the energy to answer this before now, but here's an example that hopefully shows the issue with allowCross by adding a comparison! NB: The bug only shows when you actually hold and drag on an endpoint, clicking along the range works fine. |
I'm encountering the same issue, |
Any news on this one? Is there any other workaround instead of hacking rc-slider code? |
Fixed in |
This issue seems to have been marked as fixed, but the functionality is (partially?) broken again in the latest version (8.5.0) Can be reproduced on the examples-page for this component (http://react-component.github.io/slider/examples/range.html), on the following examples:
|
Couldn't think of a better title to this
I encountered a strange issue when attempting to implement a sort of wrapper component around the rc-slider.
When implementing an onChange containing a setState, the third value in the range slider is set to the same value as the second when dragging the first. The setState does not necessarily need to modify values used by the rc-slider for this to break.
For instance: A range of [20, 66, 70] becomes [21, 66, 66] when dragging the first handle. This also fails when dragging the last handle.
I tracked this to the "ensureValueNotConflict"-function in Range.js component on line 336. It is called in the componentWillReceiveProps, and this is why it breaks:
A hacky fix I came up with is to pass the index to ensureValueNotConflict and then use that to skip values that aren't next to the dragged value
And then modifying ensureValueNotConflict like this:
This seems to solve my issue
The text was updated successfully, but these errors were encountered: