Fix A11y read changes description in dashboard
Regressed in Change 329580. For A11y to read row about change, other
rows (gr-change-list-items) need to have tabIndex=-1
Release-Notes: skip
Google-Bug-Id: b/234832728
Change-Id: I45d61f4acf85849b732a0c351a40355d5d85dd11
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts b/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts
index a7360e3..5e66fff 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts
@@ -20,7 +20,6 @@
import {sharedStyles} from '../../../styles/shared-styles';
import {Metadata} from '../../../utils/change-metadata-util';
import {WAITING} from '../../../constants/constants';
-import {ifDefined} from 'lit/directives/if-defined';
import {provide} from '../../../models/dependency';
import {
bulkActionsModelToken,
@@ -296,7 +295,7 @@
) {
const ariaLabel = this.computeAriaLabel(change);
const selected = this.computeItemSelected(index);
- const tabindex = this.computeTabIndex(index);
+ const tabIndex = this.computeTabIndex(index);
return html`
<gr-change-list-item
.account=${this.account}
@@ -307,9 +306,10 @@
.visibleChangeTableColumns=${columns}
.showNumber=${this.showNumber}
?showStar=${this.showStar}
- tabindex=${ifDefined(tabindex)}
+ tabindex=${tabIndex}
.labelNames=${this.labelNames}
aria-label=${ariaLabel}
+ role="button"
></gr-change-list-item>
`;
}
@@ -346,7 +346,7 @@
private computeTabIndex(index: number) {
if (this.isCursorMoving) return 0;
- return this.computeItemSelected(index) ? 0 : undefined;
+ return this.computeItemSelected(index) ? 0 : -1;
}
// private but used in test