-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Accessible sort buttons #12217
Accessible sort buttons #12217
Changes from 6 commits
d05e8ee
9c6acbf
e78300b
27e6afc
8327d76
fe46d06
84bb7e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,55 @@ | ||
<tr> | ||
<th width="1%"></th> | ||
<th ng-if="indexPattern.timeFieldName" data-test-subj="docTableHeaderField"> | ||
<span>Time <i ng-class="headerClass(indexPattern.timeFieldName)" ng-click="cycleSortOrder(indexPattern.timeFieldName)" tooltip="Sort by time"></i></span> | ||
<span>Time <button | ||
id="docTableHeaderFieldSort{{indexPattern.timeFieldName}}" | ||
tabindex="0" | ||
aria-label="{{ getAriaLabelForColumn(indexPattern.timeFieldName) }}" | ||
class="docTableHeaderButton" | ||
ng-class="headerClass(indexPattern.timeFieldName)" | ||
role="button" | ||
ng-click="cycleSortOrder(indexPattern.timeFieldName)" | ||
tooltip="Sort by time" | ||
></button> | ||
</span> | ||
</th> | ||
<th ng-repeat="name in columns" data-test-subj="docTableHeaderField"> | ||
<span class="table-header-name"> | ||
{{name | shortDots}} <i ng-class="headerClass(name)" ng-click="cycleSortOrder(name)" tooltip="{{tooltip(name)}}" tooltip-append-to-body="1"></i> | ||
</span> | ||
<span class="table-header-move"> | ||
<i | ||
class="fa fa-remove" | ||
ng-click="onRemoveColumn(name)" | ||
ng-if="canRemoveColumn(name)" | ||
tooltip-append-to-body="1" | ||
tooltip="Remove column" | ||
></i> | ||
<i | ||
class="fa fa-angle-double-left" | ||
ng-click="moveColumnLeft(name)" | ||
ng-if="canMoveColumnLeft(name)" | ||
tooltip-append-to-body="1" | ||
tooltip="Move column to the left" | ||
></i> | ||
<i | ||
class="fa fa-angle-double-right" | ||
ng-click="moveColumnRight(name)" | ||
ng-if="canMoveColumnRight(name)" | ||
{{name | shortDots}} | ||
<button | ||
id="docTableHeaderFieldSort{{name}}" | ||
tabindex="0" | ||
aria-label="{{ getAriaLabelForColumn(name) }}" | ||
class="docTableHeaderButton" | ||
ng-class="headerClass(name)" | ||
ng-click="cycleSortOrder(name)" | ||
tooltip="{{tooltip(name)}}" | ||
tooltip-append-to-body="1" | ||
tooltip="Move column to the right" | ||
></i> | ||
></button> | ||
</span> | ||
<button | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add an aria-label="Remove {{name}} column" |
||
class="fa fa-remove table-header-move" | ||
ng-click="onRemoveColumn(name)" | ||
ng-if="canRemoveColumn(name)" | ||
tooltip-append-to-body="1" | ||
tooltip="Remove column" | ||
aria-label="Remove {{name}} column" | ||
></button> | ||
<button | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this one: aria-label="Move {{name}} column to the left" |
||
class="fa fa-angle-double-left table-header-move" | ||
ng-click="moveColumnLeft(name)" | ||
ng-if="canMoveColumnLeft(name)" | ||
tooltip-append-to-body="1" | ||
tooltip="Move column to the left" | ||
aria-label="Move {{name}} column to the left" | ||
></button> | ||
<button | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This guy too: aria-label="Move {{name}} column to the right" |
||
class="fa fa-angle-double-right table-header-move" | ||
ng-click="moveColumnRight(name)" | ||
ng-if="canMoveColumnRight(name)" | ||
tooltip-append-to-body="1" | ||
tooltip="Move column to the right" | ||
aria-label="Move {{name}} column to the left" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be "Move {{name}} column to the right". |
||
></button> | ||
</th> | ||
</tr> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,9 @@ doc-table { | |
opacity: 1; /* 3 */ | ||
} | ||
} | ||
|
||
.docTableHeaderButton { | ||
border: none; | ||
background: none; | ||
padding: 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution! A few lines below, I think we also need to update this markup similarly:
I think this is what drives the appearance of the sort button for a non-time columns (e.g.
geo.srcdest
). To show this column in the table header, just expand open a row and click this icon:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was addressed.