Skip to content

Commit fa4727d

Browse files
committed
fix: Update the select options correctly
The Select component options are a prop that initializes the state variable `filteredOptions`. The issue was, that if the prop is updated, the state variable doesn't seem to be updated as well. This fixes that by manually updating the state variable whenever the prop updates.
1 parent 6530284 commit fa4727d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/desktop/src/lib/select/Select.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
let listOpen = $state(false);
5656
let inputBoundingRect = $state<DOMRect>();
5757
58+
$effect(() => {
59+
filteredOptions = options;
60+
});
61+
5862
const maxBottomPadding = 20;
5963
6064
function setMaxHeight() {

0 commit comments

Comments
 (0)