Skip to content

Commit

Permalink
Improve date picker accessibility (elastic#12676)
Browse files Browse the repository at this point in the history
* Add aria-labels to date-picker buttons (Fix elastic#12634)

* Remove redundant gridcell role (Fix elastic#12673)
  • Loading branch information
timroes authored Jul 12, 2017
1 parent 3fe58e9 commit bc8f394
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/ui/public/angular-bootstrap/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst

scope.title = [years[0].label, years[range - 1].label].join(' - ');
scope.rows = ctrl.split(years, 5);
scope.yearRange = ctrl.yearRange;
};

ctrl.compare = function(date1, date2) {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/angular-bootstrap/datepicker/day.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
type="button"
class="kuiDatePickerNavigationButton"
ng-click="move(-1)"
aria-label="Previous month"
>
<span class="kuiIcon fa-chevron-left"></span>
</button>
Expand All @@ -35,6 +36,7 @@
type="button"
class="kuiDatePickerNavigationButton"
ng-click="move(1)"
aria-label="Next month"
>
<span class="kuiIcon fa-chevron-right"></span>
</button>
Expand All @@ -61,7 +63,6 @@
ng-repeat="dt in row track by dt.date"
class="kuiDatePickerRowCell"
ng-class="{'kuiDatePickerRowCell-isBlocked': dt.disabled && !dt.secondary}"
role="gridcell"
id="{{dt.uid}}"
aria-disabled="{{!!dt.disabled}}"
>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/angular-bootstrap/datepicker/month.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
type="button"
class="kuiDatePickerNavigationButton"
ng-click="move(-1)"
aria-label="Previous year"
>
<span class="kuiIcon fa-chevron-left"></span>
</button>
Expand All @@ -35,6 +36,7 @@
type="button"
class="kuiDatePickerNavigationButton"
ng-click="move(1)"
aria-label="Next year"
>
<span class="kuiIcon fa-chevron-right"></span>
</button>
Expand All @@ -48,7 +50,6 @@
ng-repeat="dt in row track by dt.date"
class="kuiDatePickerRowCell"
ng-class="{'kuiDatePickerRowCell-isBlocked': dt.disabled && !dt.secondary}"
role="gridcell"
id="{{dt.uid}}"
aria-disabled="{{!!dt.disabled}}"
>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/angular-bootstrap/datepicker/year.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
type="button"
class="kuiDatePickerNavigationButton"
ng-click="move(-1)"
aria-label="Previous {{yearRange}} years"
>
<span class="kuiIcon fa-chevron-left"></span>
</button>
Expand All @@ -35,6 +36,7 @@
type="button"
class="kuiDatePickerNavigationButton"
ng-click="move(1)"
aria-label="Next {{yearRange}} years"
>
<span class="kuiIcon fa-chevron-right"></span>
</button>
Expand All @@ -48,7 +50,6 @@
ng-repeat="dt in row track by dt.date"
class="kuiDatePickerRowCell"
ng-class="{'kuiDatePickerRowCell-isBlocked': dt.disabled && !dt.secondary}"
role="gridcell"
id="{{dt.uid}}"
aria-disabled="{{!!dt.disabled}}"
>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/kbn_top_nav/kbn_top_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
class="kuiLocalDropdown"
ng-show="kbnTopNav.rendered"
>
<button class="kuiLocalDropdownCloseButton" ng-click="kbnTopNav.close()">
<button class="kuiLocalDropdownCloseButton" ng-click="kbnTopNav.close()" aria-label="Close">
<span class="kuiIcon fa-chevron-circle-up"></span>
</button>
<div id="template_wrapper">
Expand Down

0 comments on commit bc8f394

Please sign in to comment.