-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[Slider] Allow mobile VO users to interact with Sliders #23902
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9302785
[Slider] Allows slider to work with mobile Voice Over technology
CodySchaaf 847a6e4
Merge branch 'next' into fix/slider/fix-a11y-for-mobile
eps1lon 89ce67e
Fix announcement in VO+(chrome,safari) desktop
eps1lon d8c9cc2
Test unstyled in browser
eps1lon 990878b
Set webkitAppearance on the actual slider
eps1lon 300ab99
Fix test in jsdom
eps1lon 592273d
Make sure we can inspect if the workaround test is ran
eps1lon 5faa99b
Restore previous VO focus indicator
eps1lon b7a5f66
Rely less on DOM structure
eps1lon 42ba74b
Fix missing input when valueLabelDisplay="auto"
eps1lon 332dead
Fix slider being excluded from a11y tree
eps1lon 8b4c50c
fix es module interop with prop-types
eps1lon 72096c3
Merge branch 'next' into fix/slider/fix-a11y-for-mobile
eps1lon 4f9c003
Fix airbnb slider
eps1lon 5201ab3
Fix propTypes
eps1lon 6ba9062
Merge branch 'next' into fix/slider/fix-a11y-for-mobile
eps1lon c9daecd
Revert webkitAppearance and document everything we know so far
eps1lon d94e918
Apply suggestions from code review
eps1lon f691059
Merge branch 'next' into fix/slider/fix-a11y-for-mobile
eps1lon 552f608
Use kbd for arrow keys
eps1lon da05e8d
use sx
eps1lon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
docs/src/pages/components/slider/VerticalAccessibleSlider.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import * as React from 'react'; | ||
| import Box from '@material-ui/core/Box'; | ||
| import Typography from '@material-ui/core/Typography'; | ||
| import Slider from '@material-ui/core/Slider'; | ||
|
|
||
| export default function VerticalSlider() { | ||
| function preventHorizontalKeyboardNavigation(event) { | ||
| if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') { | ||
| event.preventDefault(); | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <Typography id="vertical-accessible-slider" gutterBottom> | ||
| Temperature | ||
| </Typography> | ||
| <Box sx={{ height: 300 }}> | ||
| <Slider | ||
| sx={{ | ||
| '& input[type="range"]': { | ||
| WebkitAppearance: 'slider-vertical', | ||
| }, | ||
| }} | ||
| orientation="vertical" | ||
| defaultValue={30} | ||
| aria-labelledby="vertical-accessible-slider" | ||
| onKeyDown={preventHorizontalKeyboardNavigation} | ||
| /> | ||
| </Box> | ||
| </React.Fragment> | ||
| ); | ||
| } |
33 changes: 33 additions & 0 deletions
33
docs/src/pages/components/slider/VerticalAccessibleSlider.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import * as React from 'react'; | ||
| import Box from '@material-ui/core/Box'; | ||
| import Typography from '@material-ui/core/Typography'; | ||
| import Slider from '@material-ui/core/Slider'; | ||
|
|
||
| export default function VerticalSlider() { | ||
| function preventHorizontalKeyboardNavigation(event: React.KeyboardEvent) { | ||
| if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') { | ||
| event.preventDefault(); | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <Typography id="vertical-accessible-slider" gutterBottom> | ||
| Temperature | ||
| </Typography> | ||
| <Box sx={{ height: 300 }}> | ||
| <Slider | ||
| sx={{ | ||
| '& input[type="range"]': { | ||
| WebkitAppearance: 'slider-vertical', | ||
| }, | ||
| }} | ||
| orientation="vertical" | ||
| defaultValue={30} | ||
| aria-labelledby="vertical-accessible-slider" | ||
| onKeyDown={preventHorizontalKeyboardNavigation} | ||
| /> | ||
| </Box> | ||
| </React.Fragment> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.