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] Use un-rounded values to position thumbs #1219

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Dec 23, 2024

Closes #1216

Added a new state to hold un-rounded percentage values used for positioning thumbs.

Tried to replace the internal state with this and "scale up" the values on-demand (e.g. formatting, callbacks) but it requires a huge refactoring of internal calculations and increases the risk of floating point inaccuracies so I gave up for now.

Also threw in some improvements: removed unnecessary destructure/spreads/object arguments, renamed a lot of internals

@mj12albert mj12albert added the component: slider This is the name of the generic UI component, not the React module! label Dec 23, 2024
@mj12albert mj12albert force-pushed the fix/slider-indicator-size-rounding branch from 45a1d37 to 0d89ea6 Compare December 23, 2024 10:44
@mui-bot
Copy link

mui-bot commented Dec 23, 2024

Netlify deploy preview

https://deploy-preview-1219--base-ui.netlify.app/

Generated by 🚫 dangerJS against f8e2ad3

@mj12albert mj12albert force-pushed the fix/slider-indicator-size-rounding branch 8 times, most recently from 3985be0 to 9e8b591 Compare December 25, 2024 21:06
@mj12albert mj12albert force-pushed the fix/slider-indicator-size-rounding branch 4 times, most recently from b9812b3 to 89105bc Compare January 2, 2025 08:56
@mj12albert mj12albert changed the title fix/slider-indicator-size-rounding [Slider] Use un-rounded values to position thumbs Jan 2, 2025
@mj12albert mj12albert marked this pull request as ready for review January 2, 2025 09:48
@mj12albert mj12albert added the enhancement This is not a bug, nor a new feature label Jan 2, 2025
@mj12albert mj12albert force-pushed the fix/slider-indicator-size-rounding branch from 89105bc to 6acd84b Compare January 3, 2025 07:14
@atomiks
Copy link
Contributor

atomiks commented Jan 3, 2025

Seems to be buggy when moving quickly

Screen.Recording.2025-01-03.at.6.19.35.pm.mov

@mj12albert
Copy link
Member Author

mj12albert commented Jan 3, 2025

Seems to be buggy when moving quickly

Should be fixed ~ it needed to be clamped now @atomiks

@mj12albert mj12albert force-pushed the fix/slider-indicator-size-rounding branch from 2fec4ed to c7b00da Compare January 3, 2025 10:07
@mj12albert mj12albert force-pushed the fix/slider-indicator-size-rounding branch from c7b00da to f8e2ad3 Compare January 3, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Slider] Indicator width/height are rounded too soon
3 participants