Skip to content

Commit

Permalink
refocus locale dropdown after load (microsoft#6495)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Whitten <[email protected]>
  • Loading branch information
beyackle and cwhitten authored Mar 30, 2021
1 parent 5ef6606 commit b882e83
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ const AppSettings: React.FC<RouteComponentProps> = () => {
updateUserSettings({ codeEditor: { [key]: value } });
};

const onLocaleChange = (appLocale: string) => {
updateUserSettings({ appLocale });
const onLocaleChange = async (appLocale: string) => {
await updateUserSettings({ appLocale });

setTimeout(() => {
document.getElementById('appLanguage')?.focus();
}, 100);
};

const handleDataCollectionChange = (allowDataCollection: boolean) => {
Expand Down Expand Up @@ -99,6 +103,7 @@ const AppSettings: React.FC<RouteComponentProps> = () => {
<h2>{formatMessage('Application Language settings')}</h2>
<SettingDropdown
description={formatMessage('This is the language used for Composer’s user interface.')}
id={'appLanguage'}
options={languageOptions}
selected={userSettings.appLocale}
title={formatMessage('Application language')}
Expand Down

0 comments on commit b882e83

Please sign in to comment.