This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(radio-button): when no value selected, first button not announced…
… on focus - when no value selected, set `aria-activedescendant` to first button's `id` - properly define labels and `aria-labelledby` in demos - improve some JSDoc and types - rename some variables to make them more readable - remove unused parameters - improvements to multi-column demo - remove unneeded or unused styles and elements - use `aria-describedby` to make first column available to screen reader users Fixes #11973. Fixes #11923. Fixes #11974.
- Loading branch information
Showing
9 changed files
with
103 additions
and
137 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,42 +1,33 @@ | ||
|
||
body { | ||
padding: 20px; | ||
} | ||
|
||
hr { | ||
margin-left: -20px; | ||
opacity: 0.3; | ||
} | ||
|
||
md-radio-group { | ||
width: 150px; | ||
} | ||
|
||
p:last-child { | ||
padding-bottom: 50px; | ||
} | ||
|
||
|
||
[ng-controller] { | ||
form { | ||
padding: 0 20px; | ||
} | ||
|
||
.radioValue { | ||
margin-left: 5px; | ||
color: #0f9d58; | ||
font-weight: bold; | ||
padding:5px; | ||
|
||
} | ||
|
||
md-icon { | ||
margin: 0 20px 20px; | ||
width: 128px; | ||
height: 128px; | ||
} | ||
|
||
|
||
.ipsum { | ||
color: saddlebrown; | ||
font-size: 0.9em; | ||
} | ||
.demo-description { | ||
margin-bottom: 0; | ||
} |
This file contains 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,40 +1,23 @@ | ||
<div ng-controller='ContactController as cc' class="radioDemo2 bidi"> | ||
<div ng-controller="ContactController as ctrl" class="demo-bidi"> | ||
<h2>Contact List</h2> | ||
<md-divider></md-divider> | ||
<md-divider></md-divider> | ||
|
||
<md-radio-group ng-model="cc.selectedId" > | ||
<div ng-repeat='person in cc.contacts' class="row"> | ||
<div flex layout='row' layout-padding layout-align="start center" > | ||
|
||
<div flex style="max-width:200px;"> | ||
{{person.title}} | ||
</div> | ||
<md-radio-button flex | ||
ng-value="person.id" | ||
class="md-primary" > | ||
|
||
{{person.fullName}} | ||
|
||
</md-radio-button> | ||
<md-radio-group ng-model="ctrl.selectedId" aria-labelledby="selectedUser"> | ||
<div ng-repeat="person in ctrl.contacts" class="demo-row"> | ||
<div flex layout="row" layout-padding layout-align="start center"> | ||
|
||
<div id="{{'demoTitle-' + person.id}}" class="demo-title"> | ||
{{person.title}} | ||
</div> | ||
</div> | ||
</md-radio-group> | ||
|
||
<md-divider></md-divider> | ||
<div class="summary" flex layout="row" layout-align="space-between center"> | ||
<div flex-initial> | ||
<span class="title">Selected User</span>: <span class="md-checked">{{cc.selectedUser()}}</span> | ||
<md-radio-button flex ng-value="person.id" class="md-primary" aria-describedby="{{'demoTitle-' + person.id}}"> | ||
{{person.fullName}} | ||
</md-radio-button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
|
||
html[dir="rtl"] .bidi { | ||
padding-right: 20px; | ||
padding-left:0; | ||
} | ||
|
||
</style> | ||
</md-radio-group> | ||
|
||
<md-divider></md-divider> | ||
<p class="md-padding md-margin"> | ||
<label id="selectedUser">Selected User:</label> <span class="demo-checked">{{ctrl.selectedUser()}}</span> | ||
</p> | ||
</div> |
This file contains 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 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,53 +1,23 @@ | ||
div.radioDemo2 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
|
||
h2 { | ||
margin-left : 15px; | ||
} | ||
p { | ||
width:400px; | ||
margin-top:10px; | ||
margin-left : 10px; | ||
padding-top:10px; | ||
border-top: 2px solid #ddd; | ||
margin: 16px; | ||
} | ||
|
||
.md-checked { | ||
background-color : #ECFAFB; | ||
.demo-checked { | ||
background-color: #ECFAFB; | ||
border-radius: 2px; | ||
} | ||
|
||
md-button.md-raised, button.md-raised { | ||
width: 200px; | ||
} | ||
|
||
.row { | ||
border-bottom: 1px dashed #ddd; | ||
.demo-row { | ||
border-bottom: 1px dashed #ddd; | ||
} | ||
|
||
div.row:last-child { | ||
.demo-row:last-child { | ||
border-bottom: 0px dashed #ddd; | ||
} | ||
|
||
|
||
|
||
.summary { | ||
width: 100%; | ||
padding-top:10px; | ||
margin-left: 25px; | ||
margin-top: 20px; | ||
margin-bottom:-5px | ||
} | ||
|
||
|
||
.title { | ||
label { | ||
font-weight: bolder; | ||
} | ||
|
||
.selectedUser .md-checked { | ||
padding : 8px; | ||
width: 100px; | ||
|
||
.demo-title { | ||
flex: 0 1 200px; | ||
} | ||
html[dir="rtl"] .demo-bidi { | ||
padding-right: 20px; | ||
padding-left: 0; | ||
} |
Oops, something went wrong.