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

Slider: Improve behaviour on overlapping ranges #2180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zalito12
Copy link

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.

Improve the handle detection when they overlap in slider ranges.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: zalito12 / name: Gonzalo (a50e2af)

@mgol
Copy link
Member

mgol commented Sep 6, 2023

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.

@zalito12
Copy link
Author

zalito12 commented Sep 6, 2023

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?

@mgol
Copy link
Member

mgol commented Sep 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants