Add predefined set variable values (#497)

Closes #234
This commit is contained in:
Baptiste Arnaud
2023-05-11 17:17:24 -04:00
committed by GitHub
parent 9abc50dce5
commit bde941613c
9 changed files with 222 additions and 85 deletions

View File

@@ -35,7 +35,7 @@ type Item =
type Props<T extends Item> = {
isPopoverMatchingInputWidth?: boolean
selectedItem?: string
items: T[]
items: readonly T[]
placeholder?: string
onSelect?: (value: string | undefined, item?: T) => void
}
@@ -190,11 +190,11 @@ export const Select = <T extends Item>({
/>
<InputRightElement
width={selectedItem ? '5rem' : undefined}
width={selectedItem && isOpen ? '5rem' : undefined}
pointerEvents="none"
>
<HStack>
{selectedItem && (
{selectedItem && isOpen && (
<IconButton
onClick={clearSelection}
icon={<CloseIcon />}