From 21e0465dba299e548f94e17ae5456933aa1b2398 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Fri, 10 Feb 2023 13:36:32 +0800 Subject: [PATCH] Fix: --- .../ui/src/components/Listbox/Listbox2.tsx | 26 ++++---------- .../ForeignKeySelector/ForeignKeySelector.tsx | 35 ++++++++++++------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/packages/ui/src/components/Listbox/Listbox2.tsx b/packages/ui/src/components/Listbox/Listbox2.tsx index 5366c6062b5..78f9a4bbd06 100644 --- a/packages/ui/src/components/Listbox/Listbox2.tsx +++ b/packages/ui/src/components/Listbox/Listbox2.tsx @@ -18,8 +18,7 @@ function classNames(...classes: any) { return classes.filter(Boolean).join(' ') } -export interface Props - extends Omit, 'size'> { +export interface Props extends Omit, 'size'> { className?: string children: React.ReactNode descriptionText?: string @@ -73,14 +72,8 @@ function Listbox({ const triggerRef = useRef(null) - const { - formContextOnChange, - values, - errors, - handleBlur, - touched, - fieldLevelValidation, - } = useFormContext() + const { formContextOnChange, values, errors, handleBlur, touched, fieldLevelValidation } = + useFormContext() if (values && !value) { defaultValue = values[id || name] @@ -257,9 +250,7 @@ function Listbox({ className={__styles.options_container} >
- + {children}
@@ -313,9 +304,7 @@ function SelectOption({
{addOnBefore && addOnBefore({ active, selected })} - {typeof children === 'function' - ? children({ active, selected }) - : children} + {typeof children === 'function' ? children({ active, selected }) : children}
@@ -326,10 +315,7 @@ function SelectOption({ active ? __styles.option_check_active : '' )} > -