Skip to content

Commit

Permalink
RangeSlider: Add data-index to MarkLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano authored and oliviertassinari committed Apr 5, 2020
1 parent 078fd1e commit 1313a6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/material-ui/src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ const Slider = React.forwardRef(function Slider(props, ref) {
<span className={classes.rail} />
<span className={classes.track} style={trackStyle} />
<input value={values.join(',')} name={name} type="hidden" />
{marks.map((mark) => {
{marks.map((mark, index) => {
const percent = valueToPercent(mark.value, min, max);
const style = axisProps[axis].offset(percent);

Expand Down Expand Up @@ -717,6 +717,7 @@ const Slider = React.forwardRef(function Slider(props, ref) {
/>
<span
aria-hidden
data-index={index}
style={style}
className={clsx(classes.markLabel, {
[classes.markLabelActive]: markActive,
Expand Down

0 comments on commit 1313a6e

Please sign in to comment.