From af091f5a3b277172e1060970747bbd86c6dc1855 Mon Sep 17 00:00:00 2001
From: Wolfgang Müller
Date: Sun, 31 Mar 2024 13:30:09 +0200
Subject: 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.
---
 frontend/src/lib/components/Select.svelte | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'frontend/src/lib/components/Select.svelte')

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>
 
-- 
cgit v1.2.3-2-gb3c3

