mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: use writable derived in more places (#17248)
chore(web): use writable derived in more places
This commit is contained in:
parent
d613f15606
commit
b25914c2a5
7 changed files with 14 additions and 37 deletions
|
|
@ -71,7 +71,7 @@
|
|||
* Keeps track of whether the combobox is actively being used.
|
||||
*/
|
||||
let isActive = $state(false);
|
||||
let searchQuery = $state(selectedOption?.label || '');
|
||||
let searchQuery = $derived(selectedOption?.label || '');
|
||||
let selectedIndex: number | undefined = $state();
|
||||
let optionRefs: HTMLElement[] = $state([]);
|
||||
let input = $state<HTMLInputElement>();
|
||||
|
|
@ -228,10 +228,6 @@
|
|||
|
||||
const getInputPosition = () => input?.getBoundingClientRect();
|
||||
|
||||
$effect(() => {
|
||||
searchQuery = selectedOption ? selectedOption.label : '';
|
||||
});
|
||||
|
||||
let filteredOptions = $derived.by(() => {
|
||||
const _options = options.filter((option) => option.label.toLowerCase().includes(searchQuery.toLowerCase()));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue