From 0843a7be90af91b8db5b673fa94bcfd81e1879c2 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 12 Jan 2023 16:56:59 -0600 Subject: [PATCH] Update for updated version of autocomplete (fix labels undefined) --- src/qqq/components/forms/DynamicSelect.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/qqq/components/forms/DynamicSelect.tsx b/src/qqq/components/forms/DynamicSelect.tsx index 4997544..c729076 100644 --- a/src/qqq/components/forms/DynamicSelect.tsx +++ b/src/qqq/components/forms/DynamicSelect.tsx @@ -224,7 +224,17 @@ function DynamicSelect({tableName, fieldName, fieldLabel, inForm, initialValue, setOpen(false); }} isOptionEqualToValue={(option, value) => option.id === value.id} - getOptionLabel={(option) => (option as QPossibleValue).label} + getOptionLabel={(option) => + { + // @ts-ignore + if(option && option.length) + { + // @ts-ignore + option = option[0]; + } + // @ts-ignore + return option.label + }} options={options} loading={loading} onInputChange={inputChanged}