Slider: Improve behaviour on overlapping ranges
Improve the handle detection when they overlap in slider ranges.
With this change when you click on the slider it will check if you click over the current overlapping value it will move the max handle, if you click under the value it will move the min handler. Also if you are on the ends it will move the only one you can move.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: zalito12 / name: Gonzalo (a50e2af383ca76750f0e0c97883c318ffc4aae7a)
Thanks for the PR. Can you report an issue with a test case showing what exactly it is that you'd like to fix? Also, any change like that will need unit tests.
Thanks for the PR. Can you report an issue with a test case showing what exactly it is that you'd like to fix? Also, any change like that will need unit tests.
Sure! I will, but I'm not sure about how to test this one, I should test when handles are overlapping and you click on rigth/left side, instead of trying to move the last one touched it should move the left/rigth handle correspondingly. Will click simulate over element slider work?
jQuery UI uses jQuery Simulate to simulate events and you can find many examples in unit tests. This folder is for slider: https://github.com/jquery/jquery-ui/tree/main/tests/unit/slider, have a look especially at event.js for examples of using events in tests.