Commit 16219cf9 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Wallpaper] Fix wrong tab focus on wallpaper app after previewing.

Currently, when you enter and exit the preview mode, the list items
(each wallpaper thumbnail in the current collection) lose their tabIndex
and aria-label.  This CL adds these properties back in so that the user
can tab through and the title is read out in chromevox.

Bug: 1005633
Change-Id: I60a2b2b5ea714d37bac440e9327d95b4867bc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888377Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710919}
parent b18d8880
...@@ -713,12 +713,16 @@ cr.define('wallpapers', function() { ...@@ -713,12 +713,16 @@ cr.define('wallpapers', function() {
var scrollUp = var scrollUp =
this.cachedScrollTop_ && this.cachedScrollTop_ > this.scrollTop; this.cachedScrollTop_ && this.cachedScrollTop_ > this.scrollTop;
for (var i = 0; i < this.dataModel.length; ++i) { for (var i = 0; i < this.dataModel.length; ++i) {
if (this.getListItemByIndex(i)) { const listItem = this.getListItemByIndex(i);
this.getListItemByIndex(i).classList.toggle( if (listItem) {
listItem.classList.toggle(
'first-row', 'first-row',
i < this.columns && i < this.columns &&
(this.firstIndex_ == 0 || i != this.firstIndex_ || (this.firstIndex_ == 0 || i != this.firstIndex_ ||
scrollUp)); scrollUp));
listItem.tabIndex = 0;
listItem.setAttribute(
'aria-label', this.dataModel.item(i).ariaLabel);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment