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: Marks don't line up with center of thumb #6877

Closed
1 of 2 tasks
yellowfuse opened this issue Sep 25, 2024 · 2 comments · Fixed by #6909
Closed
1 of 2 tasks

Slider: Marks don't line up with center of thumb #6877

yellowfuse opened this issue Sep 25, 2024 · 2 comments · Fixed by #6909

Comments

@yellowfuse
Copy link

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.13.0

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

On a Slider with marks, the mark position and value don't correspond with the thumb position. This can be easily seen on one of the Slider examples on the Mantine website: https://mantine.dev/core/slider/#styles-api

If you try to position the center of the thumb on (or as closely as possible) the 20% mark, the value is 19%. If you try to position it on the 80% mark, the value is 79%.

It seems the mark is not aligned to the center of the thumb, but slightly to the left. This may be confusing to users who try to position the thumb on a mark.

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
@tarunsinghofficial
Copy link

Hi @yellowfuse, I would like to work on this issue, and would love to fix it.

@zhawzid-ottj
Copy link

zhawzid-ottj commented Sep 28, 2024

fix is to remove the transform (line 181) in
mantine/packages/@mantine/core/src/components/Slider/Slider.module.css

transform: translateX(calc(var(--slider-size) / -2));

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

Successfully merging a pull request may close this issue.

3 participants