diff --git a/bun.lock b/bun.lock
index 5774b07..4959d24 100644
--- a/bun.lock
+++ b/bun.lock
@@ -29,6 +29,7 @@
"prettier-plugin-tailwindcss": "^0.6.11",
"svelte": "^5.22.5",
"svelte-check": "^4.1.5",
+ "svelte-persisted-store": "^0.12.0",
"tailwindcss": "^4.0.11",
"typescript": "^5.8.2",
"typescript-eslint": "^8.26.0",
@@ -561,6 +562,8 @@
"svelte-eslint-parser": ["svelte-eslint-parser@1.0.1", "", { "dependencies": { "eslint-scope": "^8.2.0", "eslint-visitor-keys": "^4.0.0", "espree": "^10.0.0", "postcss": "^8.4.49", "postcss-scss": "^4.0.9", "postcss-selector-parser": "^7.0.0" }, "peerDependencies": { "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" }, "optionalPeers": ["svelte"] }, "sha512-JjdEMXOJqy+dxeaElxbN+meTOtVpHfLnq9VGpiTAOLgM0uHO+ogmUsA3IFgx0x3Wl15pqTZWycCikcD7cAQN/g=="],
+ "svelte-persisted-store": ["svelte-persisted-store@0.12.0", "", { "peerDependencies": { "svelte": "^3.48.0 || ^4 || ^5" } }, "sha512-BdBQr2SGSJ+rDWH8/aEV5GthBJDapVP0GP3fuUCA7TjYG5ctcB+O9Mj9ZC0+Jo1oJMfZUd1y9H68NFRR5MyIJA=="],
+
"tailwindcss": ["tailwindcss@4.0.11", "", {}, "sha512-GZ6+tNwieqvpFLZfx2tkZpfOMAK7iumbOJOLmd6v8AcYuHbjUb+cmDRu6l+rFkIqarh5FfLbCSRJhegcVdoPng=="],
"tapable": ["tapable@2.2.1", "", {}, "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="],
diff --git a/package.json b/package.json
index aaf2d03..ce42dc9 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,7 @@
"prettier-plugin-tailwindcss": "^0.6.11",
"svelte": "^5.22.5",
"svelte-check": "^4.1.5",
+ "svelte-persisted-store": "^0.12.0",
"tailwindcss": "^4.0.11",
"typescript": "^5.8.2",
"typescript-eslint": "^8.26.0",
diff --git a/src/lib/components/ComboBox.svelte b/src/lib/components/ComboBox.svelte
index 7c83e18..e2bfdb0 100644
--- a/src/lib/components/ComboBox.svelte
+++ b/src/lib/components/ComboBox.svelte
@@ -14,19 +14,18 @@
};
let { options, onSelect, onClear, disabledItems, selectedOptionId }: ComboBoxProps = $props();
- $effect(() => console.log(selectedOptionId));
let focused = $state(false);
let selectSet = $state(false);
let inputElement: HTMLInputElement;
let dropdownElement: HTMLUListElement | null = $state(null);
let emoji: string = $state('');
-
+
const ifOptionSelected = (id: number | null) => {
let textValue = '';
- if (id) {
- const value = options.find((option) => option.id === id)
- if(value) {
+ if (id) {
+ const value = options.find((option) => option.id === id);
+ if (value) {
emoji = 'emoji' in value ? (value.emoji ?? '') : '';
textValue = 'name' in value ? value.name : '';
selectSet = true;
@@ -34,9 +33,7 @@
}
return textValue;
};
-
-
-
+
let filterInput = $state(ifOptionSelected(selectedOptionId));
let searcher = $state(new FuzzySearch(options, ['name'], { caseSensitive: false, sort: true }));
@@ -85,8 +82,8 @@
});
-
-