Skip to content

Commit

Permalink
Add described-by attribute to duration-selection directive to make ch…
Browse files Browse the repository at this point in the history
…ildren inputs screen reader accessible. (#19779) (#19886)
  • Loading branch information
cjcenizal authored Jun 14, 2018
1 parent 83c0a9c commit 685846a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
class="durationSelectSize kuiTextInput watcherNumberInput"
min="0"
required
ng-model="durationSelect.size">
ng-model="durationSelect.size"
aria-label="Duration amount"
aria-describedby="{{durationSelect.describedBy}}"
>

<select
id="{{durationSelect.makeId('unit')}}"
name="{{durationSelect.makeId('unit')}}"
class="durationSelectUnit kuiSelect"
required
ng-model="durationSelect.unit"
ng-options="commonTimeUnit as timeUnit.labelPlural for (commonTimeUnit, timeUnit) in durationSelect.timeUnits"
aria-label="Duration time unit"
aria-describedby="{{durationSelect.describedBy}}"
></select>
<div>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ app.directive('durationSelect', function ($injector) {
minimumUnit: '=',
minimumSize: '=',
unit: '=',
size: '='
size: '=',
describedBy: '@',
},
template,
replace: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,21 @@ <h2 class="kuiSubText kuiSubduedText">

<div class="kuiFieldGroupSection">
<label
id="durationSelectTriggerIntervalSizeLabel"
for="durationSelectTriggerIntervalSize"
class="kuiLabel kuiVerticalRhythmSmall">
Run this watch every
class="kuiLabel kuiVerticalRhythmSmall"
>
Run watch every
</label>
<div class="kuiVerticalRhythmSmall">

<div class="kuiVerticalRhythmSmall" id="durationSelectTriggerIntervalSize" role="group">
<duration-select
duration-id="triggerInterval"
minimum-unit="watchEditTitlePanel.triggerIntervalMinimumUnit"
minimum-size="watchEditTitlePanel.triggerIntervalMinimumSize"
unit="watchEditTitlePanel.triggerIntervalUnit"
size="watchEditTitlePanel.triggerIntervalSize"
described-by="durationSelectTriggerIntervalSizeLabel"
></duration-select>
</div>
<div class="kuiSubText kuiSubduedText kuiVerticalRhythmSmall watchEditTitlePanelIntervalValidation">
Expand Down

0 comments on commit 685846a

Please sign in to comment.