diff options
author | Wolfgang Müller | 2024-03-31 13:30:09 +0200 |
---|---|---|
committer | Wolfgang Müller | 2024-03-31 13:30:09 +0200 |
commit | af091f5a3b277172e1060970747bbd86c6dc1855 (patch) | |
tree | 9b25c52ab8b13fe881dd05713516cb7f3703237f | |
parent | 8d4a02d18537b94f5ce1d2122c3e3128d9108c81 (diff) | |
download | hircine-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.
-rw-r--r-- | frontend/src/lib/components/Select.svelte | 4 |
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> |