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

[Slider] add custom styling for mark at the end for horizontal slider

Open nicolas-ot opened this issue 2 years ago • 2 comments

fixes: https://github.com/mui/material-ui/issues/32345

This PR add custom styling to the mark at the end of the slider. Instead of having the mark text on the middle of the mark, now the text is alligned to the right of the mark, so that the text doesn't get out of bound.

This solution might be too specific. Feedback would be greatly appreciated.

An alternative solution I had is to call getBoundingClientRect function to check if the mark is inside the Slider Component. But I'm reluctant to try that because it is an expensive function to call for all marks.

nicolas-ot avatar Apr 15 '23 06:04 nicolas-ot

Netlify deploy preview

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

Bundle size report

Details of bundle changes

Generated by :no_entry_sign: dangerJS against 599922fc518f047ec86add476b815e22d7acee4c

mui-bot avatar Apr 15 '23 06:04 mui-bot

hey @mnajdova , you might have missed this PR

nicolas-ot avatar May 03 '23 08:05 nicolas-ot

@ZeeshanTamboli yes, I agree. I guess there is nothing else to do other than to close this PR, right?

Do you think a solution with getBoundingClientRect might have a future? More conretely, checking all the label position with it and position them accordingly

nicolas-ot avatar May 19 '23 13:05 nicolas-ot

I guess there is nothing else to do other than to close this PR, right?

Yes, I am closing it.

Do you think a solution with getBoundingClientRect might have a future? More conretely, checking all the label position with it and position them accordingly

The label should be positioned by overriding the styles. I think, we can't control it.

ZeeshanTamboli avatar May 20 '23 05:05 ZeeshanTamboli