-
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
Merged
cjcenizal
merged 7 commits into
elastic:master
from
aphelionz:11853-accessible-discover-sort-button
Jun 20, 2017
Merged
Accessible sort buttons #12217
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d05e8ee
First pass at creating accessible sort buttons
aphelionz 9c6acbf
A better scope function
aphelionz e78300b
Applying to other elements, fixing CSS
aphelionz 27e6afc
Better class implementation
aphelionz 8327d76
Updating buttons to use opacity
aphelionz fe46d06
Adding aria-labels
aphelionz 84bb7e4
Fixing typo
aphelionz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 | ||
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 right" | ||
></button> | ||
</th> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.