diff --git a/packages/react/src/slider/root/SliderRoot.test.tsx b/packages/react/src/slider/root/SliderRoot.test.tsx index 365d66a767..c33c875f45 100644 --- a/packages/react/src/slider/root/SliderRoot.test.tsx +++ b/packages/react/src/slider/root/SliderRoot.test.tsx @@ -110,8 +110,6 @@ describe.skipIf(typeof Touch === 'undefined')('', () => { expect(root).to.have.attribute('aria-labelledby', 'labelId'); expect(slider).to.have.attribute('aria-valuenow', '30'); - expect(slider).to.have.attribute('aria-valuemin', '0'); - expect(slider).to.have.attribute('aria-valuemax', '100'); expect(slider).to.have.attribute('aria-orientation', 'horizontal'); expect(slider).to.have.attribute('aria-labelledby', 'labelId'); expect(slider).to.have.attribute('step', '1'); @@ -455,9 +453,8 @@ describe.skipIf(typeof Touch === 'undefined')('', () => { }); describe('prop: max', () => { - it('should set the max and aria-valuemax on the input', async () => { + it('sets the max attribute on the input', async () => { await render(); - expect(screen.getByRole('slider')).to.have.attribute('aria-valuemax', '750'); expect(screen.getByRole('slider')).to.have.attribute('max', '750'); }); @@ -524,9 +521,8 @@ describe.skipIf(typeof Touch === 'undefined')('', () => { }); describe('prop: min', () => { - it('should set the min and aria-valuemin on the input', async () => { - await render(); - expect(screen.getByRole('slider')).to.have.attribute('aria-valuemin', '150'); + it('sets the min attribute on the input', async () => { + await render(); expect(screen.getByRole('slider')).to.have.attribute('min', '150'); }); diff --git a/packages/react/src/slider/root/SliderRoot.tsx b/packages/react/src/slider/root/SliderRoot.tsx index ec4af916bf..e11792967c 100644 --- a/packages/react/src/slider/root/SliderRoot.tsx +++ b/packages/react/src/slider/root/SliderRoot.tsx @@ -104,7 +104,7 @@ export const SliderRoot = React.forwardRef(function SliderRoot< const ariaLabelledby = ariaLabelledByProp ?? labelId; const disabled = fieldDisabled || disabledProp; - const name = fieldName ?? nameProp ?? ''; + const name = fieldName || nameProp; // The internal value is potentially unsorted, e.g. to support frozen arrays // https://github.com/mui/material-ui/pull/28472 diff --git a/packages/react/src/slider/root/SliderRootContext.ts b/packages/react/src/slider/root/SliderRootContext.ts index 880453f454..b12606da53 100644 --- a/packages/react/src/slider/root/SliderRootContext.ts +++ b/packages/react/src/slider/root/SliderRootContext.ts @@ -47,7 +47,7 @@ export interface SliderRootContext { * The minimum steps between values in a range slider. */ minStepsBetweenValues: number; - name: string; + name: string | undefined; /** * Function to be called when drag ends and the pointer is released. */ diff --git a/packages/react/src/slider/thumb/SliderThumb.tsx b/packages/react/src/slider/thumb/SliderThumb.tsx index 2bf5f72d06..5c69fe682a 100644 --- a/packages/react/src/slider/thumb/SliderThumb.tsx +++ b/packages/react/src/slider/thumb/SliderThumb.tsx @@ -199,8 +199,6 @@ export const SliderThumb = React.forwardRef(function SliderThumb( 'aria-labelledby': ariaLabelledByProp ?? labelId, 'aria-describedby': ariaDescribedByProp, 'aria-orientation': orientation, - 'aria-valuemax': max, - 'aria-valuemin': min, 'aria-valuenow': thumbValue, 'aria-valuetext': typeof getAriaValueTextProp === 'function'