Fix jumpy ui when changing language

Closes 7070 Spinner at wrong location when changing language
This commit is contained in:
infinite-persistence 2021-09-13 15:42:46 +08:00
parent c2a2068926
commit 40ed8059b7
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -35,20 +35,22 @@ function SettingLanguage(props: Props) {
return ( return (
<React.Fragment> <React.Fragment>
{previousLanguage && <Spinner type="small" />} {!previousLanguage && (
<FormField
name="language_select"
type="select"
onChange={onLanguageChange}
value={language || getDefaultLanguage()}
>
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
<option key={langKey} value={langKey}>
{langName}
</option>
))}
</FormField>
)}
<FormField {previousLanguage && <Spinner type="small" />}
name="language_select"
type="select"
onChange={onLanguageChange}
value={language || getDefaultLanguage()}
>
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
<option key={langKey} value={langKey}>
{langName}
</option>
))}
</FormField>
</React.Fragment> </React.Fragment>
); );
} }