mirror of
https://github.com/immich-app/immich.git
synced 2025-01-04 02:46:47 +01:00
fix(web): more language selector nits (#10271)
* fix: always sort development lang to bottom of list * fix: clear search query in languages when box is clicked
This commit is contained in:
parent
058ca28d88
commit
7de2665344
2 changed files with 7 additions and 1 deletions
|
@ -60,6 +60,7 @@
|
||||||
const activate = () => {
|
const activate = () => {
|
||||||
isActive = true;
|
isActive = true;
|
||||||
input?.select();
|
input?.select();
|
||||||
|
searchQuery = '';
|
||||||
openDropdown();
|
openDropdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,12 @@
|
||||||
|
|
||||||
const langOptions = langs
|
const langOptions = langs
|
||||||
.map((lang) => ({ label: lang.name, value: lang.code }))
|
.map((lang) => ({ label: lang.name, value: lang.code }))
|
||||||
.sort((a, b) => a.label.localeCompare(b.label));
|
.sort((a, b) => {
|
||||||
|
if (b.label.startsWith('Development')) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return a.label.localeCompare(b.label);
|
||||||
|
});
|
||||||
const defaultLangOption = { label: defaultLang.name, value: defaultLang.code };
|
const defaultLangOption = { label: defaultLang.name, value: defaultLang.code };
|
||||||
|
|
||||||
const handleLanguageChange = async (newLang: string | undefined) => {
|
const handleLanguageChange = async (newLang: string | undefined) => {
|
||||||
|
|
Loading…
Reference in a new issue