-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][Slider] Set CSS writing-mode
and update vertical slider docs
#44537
base: master
Are you sure you want to change the base?
Changes from 9 commits
3f04e20
419c8d9
7b6646e
9dc7bf7
5a25a2d
e317872
fdc1487
57af0e8
699ace5
e0ac8e1
93083a8
cc32deb
415c1ad
7f5ff37
1979ca9
e1db01a
f3261d6
e5371ea
f463c0f
9f9587c
c279aea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,17 +98,23 @@ | |
|
||
## Vertical sliders | ||
|
||
Set the `orientation` prop to `"vertical"` to create vertical sliders. The thumb will track vertical movement instead of horizontal movement. | ||
Check warning on line 101 in docs/data/material/components/slider/slider.md GitHub Actions / runner / vale
|
||
|
||
{{"demo": "VerticalSlider.js"}} | ||
|
||
**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 implement `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: | ||
|
||
However, by applying `-webkit-appearance: slider-vertical;` keyboard navigation for horizontal keys (<kbd class="key">Arrow Left</kbd>, <kbd class="key">Arrow Right</kbd>) is reversed ([chromium issue #40739626](https://issues.chromium.org/issues/40739626)). | ||
Usually, up and right should increase and left and down should decrease the value. | ||
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 { | ||
-webkit-appearance: slider-vertical; | ||
} | ||
``` | ||
|
||
{{"demo": "VerticalAccessibleSlider.js"}} | ||
For Chrome 124 and newer, the slider includes the CSS [`writing-mode`](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_writing_modes/Vertical_controls#range_sliders_meters_and_progress_bars) property that fixes this bug. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Users don't have to add this themselves, right? I would remove/rewrite this, otherwise I think people might think they need to provide it themselves. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated! |
||
::: | ||
|
||
## Marks placement | ||
|
||
|
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.
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.
Ping
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.
9f9587c
Fixed ~ @aarongarciah