-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Make interaction easier, fix thumb overflow #11889
Conversation
Hey @oliviertassinari, any update on this? |
@ValentinH I haven't looked into it beyond the Argos-CI screenshots, but it looks like this is changing the positioning of the slider. |
Indeed, I've made the touchable zone bigger so there is a bit more space around it. Is it a no-go or is it fine to change its positioning for good reasons? If not, I could remove some margin so the position remains the same but the touchable area is bigger. I'm using the slider quite often on mobile and it's really hard to interact with... |
It isn’t a major issue - we can make breaking changes in the lab with impunity. I had just assumed that the touch area could be increased without affecting the slider positioning. |
We need to decide what we want. I chose to keep an extra space so we can have a large touch area and still a bit of margin between elements (for the 2 vertical sliders of the demo for example). However, I'm not sure what is the best. Let me know what you think. 🙂 |
Ping! 🙂 |
@ValentinH I think if we can maintain the current size while making the interaction area bigger, that might be the best tradeoff. There's something up with the interaction though - if you click and move the pointer away, the slider jumps to the clicked position. Previously, the slider didn't move. Either way, looking at the spec, I'm wondering if it should slide the the clicked position as soon as it's clicked? Also, it's possible to get the pointer "attached" to the thumb, even after the button is released by clicking on the thumb and and moving the pointer away. |
Ok for the size, I'll update. I added the ability to start dragging the thumb directly by clicking anywhere on the slider. It's much easier to interact with it like this. Most sliders work like this. I didn't notice the bug you describe in your last sentence, I'll investigate :) |
Wider the clickable zone and make the whole bar receive the initial move
17e8833
to
b163c5c
Compare
@ValentinH I've iterated on your PR to solve a related issue, wherein the thumb would overflow the Slider bounding box. I'd appreciate your feedback! @epodivilov I noticed some of the tests had fallen out of sync with the implementation (we don't currently run the lab tests with CI so it got missed). I've updated most of them. Would you mind taking a look and sanity checking them? Also, the |
@mbrookes looks perfect to me! 👍 |
b163c5c
to
b0389c0
Compare
@ValentinH Thanks for working on this. 👍 @epodivilov If you get a chance to look at that test at some point that's be great! |
@mbrookes I apologize for the long wait =) I looked at the tests. Everything looks great. I did not have any problems with testing onDragEnd. Did you solve the problem or did it self-destruct? |
@epodivilov that's weird, now I'm getting 'should have called the handleDragStart cb', but I didn't change anything to affect those tests 😕 Just to confirm, did you |
@mbrookes Yes, after |
@epodivilov Wonderful, thank you! |
* [Slider] Lowest value for vertical should be at the bottom * [Slider] Fix lagging transition on vertical slider * [Slider] Fix thumb position on horizontal sliders * [docs] Document how to improve actionable area Document how to apply #11889 which was removed from default implementation in #12967.
Wider the clickable zone and make the whole bar receive the initial move.
This is especially useful on mobile as today's version is hard to use on touch-screen (12 px is too small). I've made the clickable zone 40px wide. Angular Material has it at 48px FYI.
Before:
After: