From 3e95ae356a98d01e523bdf48547db4114ff224fe Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 22 May 2023 10:40:13 -0300 Subject: fix break on build --- .../src/handlers/InputSelectMultiple.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/exchange-backoffice-ui/src/handlers/InputSelectMultiple.tsx') diff --git a/packages/exchange-backoffice-ui/src/handlers/InputSelectMultiple.tsx b/packages/exchange-backoffice-ui/src/handlers/InputSelectMultiple.tsx index dd85453e5..8369e509d 100644 --- a/packages/exchange-backoffice-ui/src/handlers/InputSelectMultiple.tsx +++ b/packages/exchange-backoffice-ui/src/handlers/InputSelectMultiple.tsx @@ -4,16 +4,16 @@ import { LabelWithTooltipMaybeRequired, UIFormProps } from "./InputLine.js"; import { useField } from "./useField.js"; import { useState } from "preact/hooks"; -export function InputSelectMultiple( +export function InputSelectMultiple( props: { choices: Choice[]; unique?: boolean; max?: number; - } & UIFormProps>, + } & UIFormProps, ): VNode { const { name, label, choices, placeholder, tooltip, required, unique, max } = props; - const { value, onChange } = useField<{ [s: string]: Array }>(name); + const { value, onChange } = useField(name); const [filter, setFilter] = useState(undefined); const regex = new RegExp(`.*${filter}.*`, "i"); @@ -21,7 +21,7 @@ export function InputSelectMultiple( return { ...prev, [curr.value]: curr.label }; }, {} as Record); - const list = value ?? []; + const list = (value ?? []) as string[]; const filteredChoices = filter === undefined ? undefined @@ -44,7 +44,7 @@ export function InputSelectMultiple( onClick={() => { const newValue = [...list]; newValue.splice(idx, 1); - onChange(newValue); + onChange(newValue as T[K]); setFilter(undefined); }} class="group relative h-5 w-5 rounded-sm hover:bg-gray-500/20" @@ -119,7 +119,7 @@ export function InputSelectMultiple( } const newValue = [...list]; newValue.splice(0, 0, v.value); - onChange(newValue); + onChange(newValue as T[K]); }} // tabindex="-1" -- cgit v1.2.3