Commit 2f409d13 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Fix focus calls in Assistant oobe-dialogs

oobe-dialog have switched to cr-lazy implementation. Instantiation of
cr-lazy template and focusing button happens in same JS event, and
it seems to work incorrectly with a11y tree (at time of focus() the
button is not considered a part of the tree).

Fix that by postponing focus() call to the next render event.

Bug: 1024092
Change-Id: I435aa720c0eac176789ff82650a27ead2b7c45c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401458Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806183}
parent 428b08c5
......@@ -177,7 +177,8 @@ Polymer({
if (!this.settingZippyLoaded_ || !this.consentStringLoaded_) {
this.reloadPage();
} else {
this.$['next-button'].focus();
Polymer.RenderStatus.afterNextRender(
this, () => this.$['next-button'].focus());
this.browserProxy_.screenShown(GET_MORE_SCREEN_ID);
this.screenShown_ = true;
}
......
......@@ -155,5 +155,7 @@ Polymer({
*/
onShow() {
this.reloadPage();
Polymer.RenderStatus.afterNextRender(
this, () => this.$['loading-dialog'].focus());
},
});
......@@ -234,7 +234,8 @@ Polymer({
if (!this.settingZippyLoaded_ || !this.consentStringLoaded_) {
this.reloadPage();
} else {
this.$['next-button'].focus();
Polymer.RenderStatus.afterNextRender(
this, () => this.$['next-button'].focus());
this.browserProxy_.screenShown(THIRD_PARTY_SCREEN_ID);
this.screenShown_ = true;
}
......
......@@ -354,6 +354,9 @@ Polymer({
'click', this.hideOverlay.bind(this));
this.valuePropView_ = this.$['value-prop-view'];
Polymer.RenderStatus.afterNextRender(
this, () => this.$['next-button'].focus());
if (!this.initialized_) {
this.valuePropView_.request.onErrorOccurred.addListener(
this.onWebViewErrorOccurred.bind(this), requestFilter);
......
......@@ -183,7 +183,8 @@ Polymer({
this.browserProxy_.screenShown(VOICE_MATCH_SCREEN_ID);
this.$['voice-match-lottie'].setPlay(true);
this.$['already-setup-lottie'].setPlay(true);
this.$['agree-button'].focus();
Polymer.RenderStatus.afterNextRender(
this, () => this.$['agree-button'].focus());
if (loadTimeData.getBoolean('hotwordDspAvailable')) {
this.$['no-dsp-message'].hidden = true;
}
......
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