Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Nov 25, 2024
1 parent fe585a2 commit 7803c4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/data/material/components/slider/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ Set the `orientation` prop to `"vertical"` to create vertical sliders. The thumb
{{"demo": "VerticalSlider.js"}}

:::warning
Chrome versions below 124 implements `aria-orientation` incorrrectly for vertical sliders and exposes them as `'horizontal'` in the accessibility tree. ([Chromium issue #40736841](https://issues.chromium.org/issues/40736841))
Chrome versions below 124 implements `aria-orientation` incorrectly for vertical sliders and exposes them as `'horizontal'` in the accessibility tree. ([Chromium issue #40736841](https://issues.chromium.org/issues/40736841))

The `-webkit-appearance: slider-vertical` CSS property can be used to correct this for these older versions, with the trade-off of causing a console warning in newer Chrome versions:

```css
.MuiSlider-thumb > input {
.MuiSlider-thumb input {
-webkit-appearance: slider-vertical;
}
```
Expand Down
10 changes: 4 additions & 6 deletions packages/mui-material/src/Slider/useSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,10 @@ export function useSlider(parameters: UseSliderParameters): UseSliderReturnValue
};
};

const cssWritingMode = React.useMemo(() => {
if (orientation === 'vertical') {
return isRtl ? 'vertical-rl' : 'vertical-lr';
}
return undefined;
}, [isRtl, orientation]);
let cssWritingMode: 'vertical-rl' | 'vertical-lr' | undefined;
if (orientation === 'vertical') {
cssWritingMode = isRtl ? 'vertical-rl' : 'vertical-lr';
}

const getHiddenInputProps = <ExternalProps extends Record<string, unknown> = {}>(
externalProps: ExternalProps = {} as ExternalProps,
Expand Down

0 comments on commit 7803c4b

Please sign in to comment.