material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[docs][material-ui] Fix slider in color customization playground twitches when sliding

Open Nashyn opened this issue 1 year ago • 2 comments

Hey, I have raised a PR that fixes a bug that I noticed in the color component in the docs where the slider twitches when between 400- 50 and henceforth I have a found a fix and updated it. Now the issue has been resolved.

Fixes #42019

https://github.com/user-attachments/assets/a5275841-5544-4117-aa1f-8ce530501dc2

Nashyn avatar Sep 09 '24 03:09 Nashyn

Netlify deploy preview

https://deploy-preview-43671--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad) No bundle size changes

Generated by :no_entry_sign: dangerJS against dd0ae0738b03d33e2b77df64b8eece3a777b6a3f

mui-bot avatar Sep 09 '24 03:09 mui-bot

Hey @ZeeshanTamboli , the issue was caused due to the Typography component dynamically resizing within the flex container, which was causing shifts when displaying the shade value. By wrapping it in a div with a fixed width, I ensured that it had a consistent space for the text, preventing shifts in the layout and stabilizing the slider. This resolved the issue by maintaing consistent alignment. Thank you.

Nashyn avatar Sep 13 '24 00:09 Nashyn

Hey @ZeeshanTamboli , Thanks for the suggestion. Setting a minWidth on the Typography component is an effective solution and simplifies the implementation. It directly addresses the layout stability without needing additional elements. I have committed the changes. Thank you.

Nashyn avatar Sep 14 '24 14:09 Nashyn

@Nashyn Thanks for the pull request.

ZeeshanTamboli avatar Sep 14 '24 16:09 ZeeshanTamboli