-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Slider] Set CSS writing-mode
and update vertical slider docs
#44537
base: master
Are you sure you want to change the base?
Conversation
writing-mode
and update vertical slider docs
4b5574e
to
5c830c3
Compare
Netlify deploy previewBundle size reportDetails of bundle changes (Toolpad) |
e3164ed
to
0c864c7
Compare
const cssWritingMode = React.useMemo(() => { | ||
if (orientation === 'vertical') { | ||
return isRtl ? 'vertical-rl' : 'vertical-lr'; | ||
} | ||
return undefined; | ||
}, [isRtl, orientation]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need React.useMemo
here? It's handling just an if statement and useMemo
itself probably does more computation than this.
If you apply `-webkit-appearance` you could prevent keyboard navigation for horizontal arrow keys for a truly vertical slider. | ||
This might be less confusing to users compared to a change in direction. | ||
```css | ||
.MuiSlider-thumb > input { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would .MuiSlider-thumb input
be a better selector? e.g. if the internal DOM structure changes and input
is not a direct child in the future, this would break. And since afaik there can only be one input
it's safe to assume that it will always target the input.
**WARNING**: Chrome, Safari and newer Edge versions that is any browser based on WebKit exposes `<Slider orientation="vertical" />` as horizontal ([chromium issue #40736841](https://issues.chromium.org/issues/40736841)). | ||
By applying `-webkit-appearance: slider-vertical;` the slider is exposed as vertical. | ||
:::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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) |
**WARNING**: Chrome, Safari and newer Edge versions that is any browser based on WebKit exposes `<Slider orientation="vertical" />` as horizontal ([chromium issue #40736841](https://issues.chromium.org/issues/40736841)). | ||
By applying `-webkit-appearance: slider-vertical;` the slider is exposed as vertical. | ||
:::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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why we actively support Chrome 109? Why the jump from 109 to 119 in https://github.com/mui/material-ui/blob/v6.1.8/.browserslistrc#L28-L29? I wonder if this warning makes sense now that Chrome is already on v131.
0c864c7
to
fe585a2
Compare
Closes #44237