-
-
Notifications
You must be signed in to change notification settings - Fork 75
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] Control
sizing, inset slider design
#981
Comments
Movements are actually relative to the
This is probably still a bug, I'll check it out |
I'll remove the horizontal padding from Control in my demo just to be safe for now, but let's still take a note to discuss later whether it's a legit design decision |
@vladmoroz "Need" seems a bit strong here? We designed it this way intentionally. When the thumb is contained, the thumb position usually doesn't visually communicate the value accurately, and the pointer becomes misaligned. The current approach seems like a better design? |
@colmtuite I'd actually argue that inset thumb has to be the default
Slider isn't a component for entering precise values anyway, so this doesn't seem like the most important constraint here. Sometimes it's important, sure—I'm well aware of radix-ui/primitives#1966, but precise mapping is more of an edge case for slider in my opinion. It's fine as long as it's going to be an option. Otherwise, we can't ignore a class of slider designs, like this one: Centered thumb wouldn't work in UIs like this one too because it would yield a layout collision: iOS sliders are the same. Because of potential layout collisions and misalignments, I'd almost never want to use a centered thumb—I wouldn't use a slider when a precise value matters anyway.
This has always seemed just like an implementation mistake in Radix. Don't see why it should be misaligned—if thumb has, say, 100px of travel, that should be covered by 100px of pointer travel. Native range input sliders (which are inset by default) and macOS sliders don't have this issue: https://jsfiddle.net/1j9x06yu/ One more point to consider is that with Radix, it's possible to implement a centered thumb yourself via a 0px thumb element and pseudo elements for the visual thumb, but the reverse doesn't work—you can't implement an inset thumb with the design that we have. Altogether, I think we need something like |
Yes, if we're setting
Hmm right yeah, it's nested inside the track so it just needs a way to handle width |
This comment was marked as outdated.
This comment was marked as outdated.
Control
sizing, inset slider design
Control
sizing, inset slider designControl
sizing, inset slider design
minStepsBetweenValues
name wasn't too intuitive—will think if there's something betterScreen.Recording.2024-12-06.at.15.47.26.mov
Not sure what Control sizing has to do anything with the cursor movement; I'd expect it all to be done relative to the Track
Done
I expected divs instead of spans, would have saved me a couple situations when my width/height styles wouldn't work right away[Slider] API Tweaks #1017Indicator has position absolute, which makes it harder to style. I don't understand how this is helping me. See this PR for an example.[Slider] API Tweaks #1017Note: when closing this issue, please make sure that this and this kludge in the demos are removed.[docs] Remove position property from Slider demos #1054Thumb has position absolute, which makes sense. However, if it's positioned absolutely, we need to specify relative to what, otherwise it's a gotcha for the dev to figure out and find the Thumb in a random position on the page first. We need to set[Slider] API Tweaks #1017position: relative
on the Track.Search keywords:
The text was updated successfully, but these errors were encountered: