Skip to content

[material-ui][Slider] Fix value prop type warning#44131

Merged
ZeeshanTamboli merged 8 commits intomui:masterfrom
joshkel:slide-value-label-prop-types
Oct 26, 2024
Merged

[material-ui][Slider] Fix value prop type warning#44131
ZeeshanTamboli merged 8 commits intomui:masterfrom
joshkel:slide-value-label-prop-types

Conversation

@joshkel
Copy link
Copy Markdown
Contributor

@joshkel joshkel commented Oct 16, 2024

Fixes #44130

@oliviertassinari oliviertassinari changed the title Fix SliderValueLabel propTypes [slider] Fix SliderValueLabel propTypes Oct 16, 2024
@oliviertassinari oliviertassinari added type: bug It doesn't behave as expected. scope: slider Changes related to the slider. typescript type: regression A bug, but worse, it used to behave as expected. labels Oct 16, 2024
@oliviertassinari oliviertassinari changed the title [slider] Fix SliderValueLabel propTypes [slider] Fix SliderValueLabel types Oct 16, 2024
Copy link
Copy Markdown
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool to see prop-types > types in this instance (SliderValueLabelProps is unable to update its type to match valueLabelFormat returned value). I guess we could use a generic to support this but it would complexity the types.

Comment thread packages/mui-material/src/Slider/SliderValueLabel.types.ts Outdated
The reference to "an array with two values" looks like it was copied and pasted from Slider's `value` prop, but for this component, value is a single item.

Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Signed-off-by: Josh Kelley <joshkel@gmail.com>
@aarongarciah aarongarciah changed the title [slider] Fix SliderValueLabel types [Slider] Fix SliderValueLabel types Oct 22, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [Slider] Fix SliderValueLabel types [material-ui][Slider] Fix SliderValueLabel value type Oct 26, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Slider] Fix SliderValueLabel value type [material-ui][Slider] Fix SliderValueLabel value proptype warning Oct 26, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][Slider] Fix SliderValueLabel value proptype warning [material-ui][Slider] Fix value prop type warning Oct 26, 2024
@mui-bot
Copy link
Copy Markdown

mui-bot commented Oct 26, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against eee1d2d

Copy link
Copy Markdown
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshkel I pushed few changes. Thanks for the pull request.

@ZeeshanTamboli ZeeshanTamboli merged commit 758cdec into mui:master Oct 26, 2024
@joshkel joshkel deleted the slide-value-label-prop-types branch October 28, 2024 13:51
@oliviertassinari oliviertassinari removed the type: bug It doesn't behave as expected. label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: slider Changes related to the slider. type: regression A bug, but worse, it used to behave as expected. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[material-ui][Slider] Incorrect warning: "Invalid prop value of type string supplied to MuiSliderValueLabel, expected number"

4 participants