Skip to content

Commit

Permalink
Fix minor a11y issues in field filter
Browse files Browse the repository at this point in the history
aria-expanded is a true/false/undefined state so we need to make sure
even if showFilter is undefined, we will print false (that's why the
double negation)

aria-haspopup doesn't really fit, since this is not a popup in the sense
the ARIA standard describes ("A popup is generally presented visually as
a group of items that appears to be on top of the main page content.")

Add aria-controls to reference the controlled element.

Fix elastic#12638 and toggle label when filter toggles
  • Loading branch information
timroes committed Jul 6, 2017
1 parent 4d481a2 commit fa9d68d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ <h3 class="sidebar-list-header-label" id="available_fields" tabindex="0">Availab
ng-class="{ 'kuiButton--basic': !filter.active, 'kuiButton--primary': filter.active, 'hidden-xs': !showFields, 'hidden-sm': !showFields }"
class="kuiButton kuiButton--small pull-right discover-field-filter-toggle"
ng-click="showFilter = !showFilter"
aria-label="Show field settings"
aria-haspopup="true"
aria-expanded="{{showFilter}}"
aria-label="{{showFilter ? 'Hide' : 'Show'}} field settings"
aria-expanded="{{!!showFilter}}"
aria-controls="discover-field-filter"
>
<span aria-hidden="true" class="kuiIcon fa-gear"></span>
</button>
</h3>
</div>

<div class="sidebar-item discover-field-details" ng-show="showFilter">
<div class="sidebar-item discover-field-details" ng-show="showFilter" id="discover-field-filter">
<form role="form">
<div class="form-group">
<label for="discoverFieldChooserFilterAggregatable">
Expand Down

0 comments on commit fa9d68d

Please sign in to comment.