-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[joy-ui][slider] Slider is draggable beyond bounds (touch) #39362
Comments
It looks like the issue comes from |
I notice that the trigger area to capture dragging/touch expands to the box that encapsulates the slider. |
Yes, the area to click is a bit larger than the track and thumb to make it easier to aim. |
@michaldudak @siriwatknp we would like to pick this up. |
Let's discuss the desired behavior with @siriwatknp first. |
Here's another reason why this is currently a problem: I have a colorpicker and when I close it, the slider get's triggered. (tested in dev-tools, so I'm not sure if this even applies on a real mobile device) Recording.2023-10-18.122734.mp4 |
Have you tested the experience on a real mobile device to see if the scenario is same there as well? |
This is to have a minimum touch area for touchscreen devices. @zanivan @danilo-leal Do you have a source to follow the minimum touch area that we can refer to? @pixelass For workaround, this can be customize via <Slider
sx={{ "--Slider-size": "32px" }}
/> https://codesandbox.io/s/fervent-aryabhata-l6dccw?file=/src/Demo.tsx:252-536 |
Yeah! There is some touch target documentation out there, but to sum it up, for small area components such as a slider's thumb, I think between 42 and 48px is a healthy target.
One thing that I think it'd be helpful there, though, is having the focus treatment (potentially on mobile only) fill the entire touch space; otherwise, it's indeed confusing to understand why the slider works if you're "apparently" not touching it. 🤔 |
The current touch area is |
@siriwatknp I would rather use |
I think Google/Lighhouse expects 48px based on the Android guidelines: https://support.google.com/accessibility/android/answer/7101858?hl=en There was a very detailed discussion on this: GoogleChrome/lighthouse#4358 This is also mentioned in the material-design specs: https://m2.material.io/design/usability/accessibility.html#assistive-technology
I tested this and it is noticeable but not as crucial since iOS seems to block certain touches when a scroll happens. I haven't tested in on an Android though. |
I did some further testing on iOS. Go to the "track" section of the docs. There seems to be a difference in the slider being focused. There is definitely a certain annoyance and potential danger in making unwanted adjustments while scrolling. But overall on a real device is seems a "a lot" better than on the dev tools or iOS simulator. |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://mui.com/joy-ui/react-slider/
Steps:
root
Current behavior 😯
On touch devices the dragging of the slider works far beyond the root element.
Screenshot: the gaps either drag the upper or lower slider
If an interactive element is in the gap, the behavior is as expected
Screencast
Recording.2023-10-09.182101.mp4
Recording.2023-10-09.182828.mp4
Expected behavior 🤔
I expect to be able do click on an area outside the slider bounds without triggering the slider itself, so that I can perform actions like scrolling.
Context 🔦
I have a page with several slider stacked in a box. I want to scroll the page on mobile, but it is impossible because each slider is somehow blocking me and triggering the slider instead of scrolling.
This breaks my UI/UX.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: