Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/react/src/slider/root/SliderRoot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ describe.skipIf(typeof Touch === 'undefined')('<Slider.Root />', () => {
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');
Expand Down Expand Up @@ -455,9 +453,8 @@ describe.skipIf(typeof Touch === 'undefined')('<Slider.Root />', () => {
});

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(<TestSlider defaultValue={150} step={100} max={750} />);
expect(screen.getByRole('slider')).to.have.attribute('aria-valuemax', '750');
expect(screen.getByRole('slider')).to.have.attribute('max', '750');
});

Expand Down Expand Up @@ -524,9 +521,8 @@ describe.skipIf(typeof Touch === 'undefined')('<Slider.Root />', () => {
});

describe('prop: min', () => {
it('should set the min and aria-valuemin on the input', async () => {
await render(<TestSlider defaultValue={150} step={100} min={150} />);
expect(screen.getByRole('slider')).to.have.attribute('aria-valuemin', '150');
it('sets the min attribute on the input', async () => {
await render(<TestSlider defaultValue={150} step={100} min={150} max={200} />);
expect(screen.getByRole('slider')).to.have.attribute('min', '150');
});

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/slider/root/SliderRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/slider/root/SliderRootContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/slider/thumb/SliderThumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading