diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx index 059160965e..f2ca32d660 100644 --- a/web/app/components/base/select/index.tsx +++ b/web/app/components/base/select/index.tsx @@ -202,10 +202,10 @@ const SimpleSelect: FC = ({ setSelectedItem(defaultSelect) }, [defaultValue]) - const openRef = useRef(false) + const listboxRef = useRef(null) return ( - { if (!disabled) { @@ -253,94 +253,44 @@ const SimpleSelect: FC = ({ )} - return ( - -
- - {renderTrigger - ? {renderTrigger(selectedItem)} - : ( - - {selectedItem?.name ?? localPlaceholder} - - {isLoading ? - : (selectedItem && !notClearable) - ? ( - { - e.stopPropagation() - setSelectedItem(null) - onSelect({ name: '', value: '' }) - }} - className="h-4 w-4 cursor-pointer text-text-quaternary" - aria-hidden="false" - /> - ) - : ( - open ? ( - - + {(!disabled) && ( + + {items.map((item: Item) => ( + + {({ /* active, */ selected }) => ( + <> + {renderOption + ? renderOption({ item, selected }) + : (<> + {item.name} + {selected && !hideChecked && ( + + + )} + )} + )} - - - {(!disabled) && ( - - - {items.map((item: Item) => ( - - {({ selected }) => ( - <> - {renderOption - ? renderOption({ item, selected }) - : (<> - {item.name} - {selected && !hideChecked && ( - - - )} - )} - - )} - - ))} - - - )} -
-
- ) - }} + + ))} + + )} + + )}
) }