-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(slider): various a11y fixes #4602
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
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,60 @@ | ||
<h1>Default Slider</h1> | ||
Label <md-slider #slidey></md-slider> | ||
Label <md-slider #slidey aria-label="Basic slider"></md-slider> | ||
{{slidey.value}} | ||
|
||
<h1>Colors</h1> | ||
<md-slider color="primary" value="50" thumbLabel></md-slider> | ||
<md-slider color="accent" value="50" thumbLabel></md-slider> | ||
<md-slider color="warn" value="50" thumbLabel></md-slider> | ||
<md-slider color="primary" value="50" thumbLabel aria-label="Primary color slider"></md-slider> | ||
<md-slider color="accent" value="50" thumbLabel aria-label="Accent color slider"></md-slider> | ||
<md-slider color="warn" value="50" thumbLabel aria-label="Warn color slider"></md-slider> | ||
|
||
<h1>Slider with Min and Max</h1> | ||
<input [(ngModel)]="min"> | ||
<md-slider [min]="min" [max]="max" tickInterval="5" #slider2></md-slider> | ||
<input [(ngModel)]="min" type="number"> | ||
<md-slider [min]="min" [max]="max" tickInterval="5" #slider2 aria-label="Min & max slider"> | ||
</md-slider> | ||
{{slider2.value}} | ||
<input [(ngModel)]="max"> | ||
<input [(ngModel)]="max" type="number"> | ||
|
||
<h1>Disabled Slider</h1> | ||
<md-slider disabled [(ngModel)]="disabledValue" [tickInterval]="1"></md-slider> | ||
<input [(ngModel)]="disabledValue"> | ||
<md-slider disabled [(ngModel)]="disabledValue" [tickInterval]="1" aria-label="Disabled slider"> | ||
</md-slider> | ||
<input [(ngModel)]="disabledValue" type="number"> | ||
|
||
<h1>Slider with set value</h1> | ||
<md-slider value="43"></md-slider> | ||
<md-slider value="43" aria-label="Initial value slider"></md-slider> | ||
|
||
<h1>Slider with step defined</h1> | ||
<md-slider min="1" max="100" step="20" #slider5></md-slider> | ||
<md-slider min="1" max="100" step="20" #slider5 aria-label="Slider with step"></md-slider> | ||
{{slider5.value}} | ||
|
||
<h1>Slider with set tick interval</h1> | ||
<md-slider tickInterval="auto"></md-slider> | ||
<md-slider tickInterval="9"></md-slider> | ||
<md-slider tickInterval="auto" aria-label="Slider with auto ticks"></md-slider> | ||
<md-slider tickInterval="9" aria-label="Slider with ticks"></md-slider> | ||
|
||
<h1>Slider with Thumb Label</h1> | ||
<md-slider thumbLabel></md-slider> | ||
<md-slider thumbLabel aria-label="Slider with thumb label"></md-slider> | ||
|
||
<h1>Slider with one-way binding</h1> | ||
<md-slider [value]="val" step="40"></md-slider> | ||
<input [(ngModel)]="val"> | ||
<md-slider [value]="val" step="40" aria-label="Slider with value binding"></md-slider> | ||
<input [(ngModel)]="val" type="number"> | ||
|
||
<h1>Slider with two-way binding</h1> | ||
<md-slider [(ngModel)]="demo" step="40"></md-slider> | ||
<input [(ngModel)]="demo"> | ||
<md-slider [(ngModel)]="demo" step="40" aria-label="Slider with ngModel"></md-slider> | ||
<input [(ngModel)]="demo" type="number"> | ||
|
||
<h1>Inverted slider</h1> | ||
<md-slider invert value="50" tickInterval="5"></md-slider> | ||
<md-slider invert value="50" tickInterval="5" aria-label="Inverted slider"></md-slider> | ||
|
||
<h1>Vertical slider</h1> | ||
<md-slider vertical thumbLabel tickInterval="auto" value="50"></md-slider> | ||
<md-slider vertical thumbLabel tickInterval="auto" value="50" aria-label="Vertical slider"> | ||
</md-slider> | ||
|
||
<h1>Inverted vertical slider</h1> | ||
<md-slider vertical invert thumbLabel tickInterval="auto" value="50"></md-slider> | ||
<md-slider vertical invert thumbLabel tickInterval="auto" value="50" | ||
aria-label="Inverted vertical slider"> | ||
</md-slider> | ||
|
||
<md-tab-group> | ||
<md-tab label="One"> | ||
<md-slider min="1" max="5" value="3"></md-slider> | ||
<md-slider min="1" max="5" value="3" aria-label="Slider in a tab"></md-slider> | ||
</md-tab> | ||
</md-tab-group> |
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
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.
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.
Capture this in a unit test?