summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/components
diff options
context:
space:
mode:
authorWolfgang Müller2024-03-31 13:30:09 +0200
committerWolfgang Müller2024-03-31 13:30:09 +0200
commitaf091f5a3b277172e1060970747bbd86c6dc1855 (patch)
tree9b25c52ab8b13fe881dd05713516cb7f3703237f /frontend/src/lib/components
parent8d4a02d18537b94f5ce1d2122c3e3128d9108c81 (diff)
downloadhircine-af091f5a3b277172e1060970747bbd86c6dc1855.tar.gz
frontend: Have optionsPlaceholder use actual value passed
A simple oversight that happened to still work. optionsPlaceholder was using 'value' from global scope which can lead to type errors because the check for undefined or null does not limit its type.
Diffstat (limited to 'frontend/src/lib/components')
-rw-r--r--frontend/src/lib/components/Select.svelte4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/src/lib/components/Select.svelte b/frontend/src/lib/components/Select.svelte
index 227959d..f7e87a4 100644
--- a/frontend/src/lib/components/Select.svelte
+++ b/frontend/src/lib/components/Select.svelte
@@ -18,10 +18,10 @@
export { inputId as id, valueAsObject as object, multiple as multi };
- function optionsPlaceholder(from: Value) {
+ function optionsPlaceholder(from: Value): Item[] {
if (from === undefined || from === null) return [];
- return Array.isArray(from) ? value : [value];
+ return Array.isArray(from) ? from : [from];
}
</script>