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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Slider handle overflows or gets cut off #1038

Closed
robkri opened this issue Mar 14, 2024 · 2 comments 路 Fixed by #1046
Closed

馃悰 Slider handle overflows or gets cut off #1038

robkri opened this issue Mar 14, 2024 · 2 comments 路 Fixed by #1046
Labels
bug Something isn't working

Comments

@robkri
Copy link
Contributor

robkri commented Mar 14, 2024

The slider's handle overflows its parent by about 11 pixels and thus might get cut off when it's at the minimum or maximum position:
slider_fluent_ui
slider_cut_off

Additional information:
In Material this is aparently prevented by indenting the entire slider on both sides to leave enough room for the handle.
slider_material

The slider shown in WinUI gallery prevents overflowing by not allowing the handle to move as far: The handle stops as soon as its outer ring touches the end of the slider bar:
slider_winUI

The latter has the advantage of a cleaner layout: The slider bar uses the entire width that the Slider widget needs and thus aligns neatly with other form elements.

Expected behaviour:
The slider handle (knob) does not overflow its parent. And ideally reproduces the behaviour seen in WinUI gallery.

@bdlukaa bdlukaa added the bug Something isn't working label Mar 15, 2024
@bdlukaa
Copy link
Owner

bdlukaa commented Mar 15, 2024

We use material's Slider under the hood of Slider. We use a "hack" to remove the indentation on the slider sides (which is added by default on the material Slider), trying to mimic the native slider behavior.

To fix this issue, the offset of the knob would need to be evaluated to proper align the thumb:
https://github.com/bdlukaa/fluent_ui/blob/master/lib/src/controls/inputs/slider.dart#L429-L554

A workaround is to add a padding (6px horizontally) onto the Slider.

@robkri
Copy link
Contributor Author

robkri commented Mar 18, 2024

Yes, this is how I'm doing it currently. Although I need 11.0 pixels padding.

dev-aniketj added a commit to dev-aniketj/fluent_ui that referenced this issue Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants