Skip to content

Commit

Permalink
[docs][material-ui][Slider] Remove valueLabelFormat from restricted…
Browse files Browse the repository at this point in the history
… values demo so that the tooltip thumb label displays the same as the value text (#41567)
  • Loading branch information
StylesTrip authored Mar 20, 2024
1 parent 01e3310 commit b96215e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
5 changes: 0 additions & 5 deletions docs/data/material/components/slider/DiscreteSliderValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@ function valuetext(value) {
return `${value}°C`;
}

function valueLabelFormat(value) {
return marks.findIndex((mark) => mark.value === value) + 1;
}

export default function DiscreteSliderValues() {
return (
<Box sx={{ width: 300 }}>
<Slider
aria-label="Restricted values"
defaultValue={20}
valueLabelFormat={valueLabelFormat}
getAriaValueText={valuetext}
step={null}
valueLabelDisplay="auto"
Expand Down
5 changes: 0 additions & 5 deletions docs/data/material/components/slider/DiscreteSliderValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@ function valuetext(value: number) {
return `${value}°C`;
}

function valueLabelFormat(value: number) {
return marks.findIndex((mark) => mark.value === value) + 1;
}

export default function DiscreteSliderValues() {
return (
<Box sx={{ width: 300 }}>
<Slider
aria-label="Restricted values"
defaultValue={20}
valueLabelFormat={valueLabelFormat}
getAriaValueText={valuetext}
step={null}
valueLabelDisplay="auto"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Slider
aria-label="Restricted values"
defaultValue={20}
valueLabelFormat={valueLabelFormat}
getAriaValueText={valuetext}
step={null}
valueLabelDisplay="auto"
Expand Down

0 comments on commit b96215e

Please sign in to comment.