| commit | 2ccf416e82256d502b3989d20c151e2bae9e8eb6 | [log] [tgz] |
|---|---|---|
| author | Tao Zhou <taoalpha@google.com> | Mon May 25 15:04:34 2020 +0200 |
| committer | Tao Zhou <taoalpha@google.com> | Mon May 25 15:04:34 2020 +0200 |
| tree | 0ec14d3d6782beab05f0bd2a8bf9f11b9fd2fcdc | |
| parent | 137a31667fdfe4f67907a687366009cd94b046d1 [diff] |
Add aria-label for expand and collapse toggle on comment Change-Id: Ie847625dc81347948cdea98ba2d8ca78dce86861
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js index 153b98d..6697880 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js
@@ -347,6 +347,10 @@ return collapsed ? 'gr-icons:expand-more' : 'gr-icons:expand-less'; } + _computeShowHideAriaLabel(collapsed) { + return collapsed ? 'Expand' : 'Collapse'; + } + _calculateActionstoShow(showActions, isRobotComment) { // Polymer 2: check for undefined if ([showActions, isRobotComment].some(arg => arg === undefined)) {
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js index 3d27042..b83cdf2 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js
@@ -277,7 +277,10 @@ ></gr-date-formatter> </span> <div class="show-hide"> - <label class="show-hide"> + <label + class="show-hide" + aria-label="[[_computeShowHideAriaLabel(collapsed)]]" + > <input type="checkbox" class="show-hide"