mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: reactivity warnings in searchbox
This commit is contained in:
parent
5ac5aa57a8
commit
8943242b7f
1 changed files with 11 additions and 0 deletions
|
|
@ -33,9 +33,13 @@
|
||||||
let isFocus = $state(false);
|
let isFocus = $state(false);
|
||||||
let close: (() => Promise<void>) | undefined;
|
let close: (() => Promise<void>) | undefined;
|
||||||
|
|
||||||
|
let navigating = false;
|
||||||
const listboxId = generateId();
|
const listboxId = generateId();
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
|
if (navigating) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
searchStore.isSearchEnabled = false;
|
searchStore.isSearchEnabled = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -44,6 +48,7 @@
|
||||||
|
|
||||||
closeDropdown();
|
closeDropdown();
|
||||||
searchStore.isSearchEnabled = false;
|
searchStore.isSearchEnabled = false;
|
||||||
|
navigating = true;
|
||||||
await goto(`${AppRoute.SEARCH}?${params}`);
|
await goto(`${AppRoute.SEARCH}?${params}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -73,6 +78,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFocusOut = () => {
|
const onFocusOut = () => {
|
||||||
|
if (navigating) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
searchStore.isSearchEnabled = false;
|
searchStore.isSearchEnabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -161,6 +169,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeDropdown = () => {
|
const closeDropdown = () => {
|
||||||
|
if (navigating) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
showSuggestions = false;
|
showSuggestions = false;
|
||||||
isFocus = false;
|
isFocus = false;
|
||||||
searchHistoryBox?.clearSelection();
|
searchHistoryBox?.clearSelection();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue