Skip to content
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

Range slider, min value over max value. #854

Closed
Alhubing opened this issue Aug 3, 2018 · 4 comments · Fixed by #864
Closed

Range slider, min value over max value. #854

Alhubing opened this issue Aug 3, 2018 · 4 comments · Fixed by #864

Comments

@Alhubing
Copy link

Alhubing commented Aug 3, 2018

Hello, i've noticed that if you create a range slider, step value set at 1, you can drag the min handle over the max handle for 1 step.

There you have the example.

http://jsfiddle.net/95chpj1d/13/

Yo have to drag the min handle, and when the min value gets to the max value, it can go 1 unit over the max.

You can check it in the console. At some point you can get an output like [0, 1] -> [1, 1] -> [2 ,1]

You can get the same behaviour if you drag the max handle over the min handle.

Thanks.

@seiyria
Copy link
Owner

seiyria commented Aug 3, 2018

It was implemented this way intentionally, if I remember correctly it will switch the handles around when it makes sense to do so.

@Alhubing
Copy link
Author

Alhubing commented Aug 6, 2018

The handles don't change until there is a difference of more than one unit.

[1,0] -> [0,0] => [1,0] => [0,2]

The correct behaviour would be

[1,0] -> [0,0] => [0,1] => [0,2]

If you give different colours to each handle you can see how the min handle goes over the max handle and they don't switch.

Thanks.

@Alhubing
Copy link
Author

Alhubing commented Aug 9, 2018

Please, could you give a hint about this?
Thank you.

@jespirit
Copy link
Collaborator

jespirit commented Oct 23, 2018

I was able to reproduce the bug. Check this JSFiddle https://jsfiddle.net/9L65wxa3/

Range starts at [5, 7]

To reproduce:

  1. Using the mouse, drag the the lower handle past the upper handle so the values are [7, 8]
  2. Tab control to the upper handle and press Left arrow twice.
  3. Result is [7, 8] => [7, 7] => [7, 6]

I have a fix which is a single line of code. I just need to add unit test for it.

jespirit added a commit to jespirit/bootstrap-slider that referenced this issue Nov 5, 2018
rovolution added a commit that referenced this issue Nov 5, 2018
Fix Issue #854 - Range slider, min value over max value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants