jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

Slider: Improve behaviour on overlapping ranges

Open zalito12 opened this issue 2 years ago • 4 comments

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.

zalito12 avatar Jul 29 '23 00:07 zalito12

CLA Signed

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.

mgol avatar Sep 06 '23 14:09 mgol

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?

zalito12 avatar Sep 06 '23 23:09 zalito12

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.

mgol avatar Sep 07 '23 08:09 mgol