Skip to content
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

Add described-by attribute to duration-selection directive to make children inputs screen reader accessible #19779

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
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