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

Fit handle within bounds #84

Open
mrleblanc101 opened this issue Mar 11, 2024 · 2 comments
Open

Fit handle within bounds #84

mrleblanc101 opened this issue Mar 11, 2024 · 2 comments

Comments

@mrleblanc101
Copy link

mrleblanc101 commented Mar 11, 2024

How do we fit handle within the slider bound ?

Screenshot 2024-03-11 at 3 54 58 PM

No-ui slider has an exemple for this here

Screenshot 2024-03-11 at 3 55 05 PM
But adding padding like in the exemple doesn't seem to work.

@mrleblanc101
Copy link
Author

By using the padding trick above, it looks like it is working at firs; the handle is aligned with the label.
Screenshot 2024-03-11 at 4 03 41 PM

But once you move the handle, you see that the background of the slider is not aligned properly.
Screenshot 2024-03-11 at 4 03 48 PM

@mrleblanc101
Copy link
Author

Seems like the noUiSlider doc was missing some things.
I found this issue: leongersen/noUiSlider#1160 (comment)
The fix is to move the background and radius on the parent.

.slider-horizontal {
    padding: 0 8px;
    background-color: var(--slider-bg);
    border-radius: var(--slider-radius);
    .slider-connects {
        margin: 0 -8px;
        width: calc(100% + 16px);
    }
}

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

No branches or pull requests

1 participant