Commit f8e73126 authored by Michael Irani's avatar Michael Irani Committed by Commit Bot

ChromeVox focus not properly shown when navigating: keyboard page

If you navigate to "Change language and input settings"
page and then back to "Keyboard" page, the arrow pointing back
to "Change language and input settings" is not highlighted
when in ChromeVox mode

Steps (in ChromeVox mode):
1. Device
2. Keyboard
3. Change language and input settings
4. Back button

Bug: 1029954
Test: Manual
Change-Id: Ib6c15179f2d217d84365927e2371a83961286f64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2487866
Commit-Queue: Michael Irani <michaelirani@chromium.org>
Auto-Submit: Michael Irani <michaelirani@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819738}
parent ba6abb54
......@@ -64,7 +64,8 @@
<settings-subpage
associated-control="[[$$('#keyboardRow')]]"
page-title="$i18n{keyboardTitle}">
<settings-keyboard prefs="{{prefs}}"></settings-keyboard>
<settings-keyboard prefs="{{prefs}}" focus-config="[[focusConfig_]]">
</settings-keyboard>
</settings-subpage>
</template>
<template is="dom-if" route-path="/stylus" no-search="[[!hasStylus_]]">
......
......@@ -142,17 +142,19 @@
label="$i18n{showKeyboardShortcutViewer}" external
deep-link-focus-id$="[[Setting.kKeyboardShortcuts]]"></cr-link-row>
<template is="dom-if" if="[[!languageSettingsV2Enabled_]]">
<cr-link-row class="hr" on-click="onShowLanguageInputTap_"
<cr-link-row id="showLanguagesDetails"
class="hr" on-click="onShowLanguageInputTap_"
label="$i18n{keyboardShowLanguageAndInput}"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</template>
<template is="dom-if" if="[[languageSettingsV2Enabled_]]">
<cr-link-row class="hr" on-click="onShowInputSettingsTap_"
<cr-link-row id="showLanguagesInput"
class="hr" on-click="onShowInputSettingsTap_"
label="$i18n{keyboardShowInputSettings}"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</template>
</template>
</template>
<script src="keyboard.js"></script>
</dom-module>
......@@ -35,6 +35,12 @@ cr.define('settings', function() {
notify: true,
},
/** @private {!Map<string, (string|Function)>} */
focusConfig: {
type: Object,
observer: 'onFocusConfigChange_',
},
/** @private Whether to show Caps Lock options. */
showCapsLock_: Boolean,
......@@ -174,6 +180,24 @@ cr.define('settings', function() {
];
},
/** @private */
onFocusConfigChange_() {
let path, id;
if (this.languageSettingsV2Enabled_) {
path = settings.routes.OS_LANGUAGES_INPUT.path;
id = '#showLanguagesInput';
} else {
path = settings.routes.OS_LANGUAGES_DETAILS.path;
id = '#showLanguageDetails';
}
this.focusConfig.set(path, () => {
Polymer.RenderStatus.afterNextRender(this, () => {
cr.ui.focusWithoutInk(assert(this.$$(id)));
});
});
},
/**
* Handler for updating which keys to show.
* @param {Object} keyboardParams
......
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