Add back ref for Selects
This commit is contained in:
parent
abf862e323
commit
604d00da90
1 changed files with 6 additions and 2 deletions
|
|
@ -20,7 +20,10 @@ interface Props
|
|||
triggerClass?: string
|
||||
}
|
||||
|
||||
const Select = (props: Props) => {
|
||||
const Select = React.forwardRef<HTMLButtonElement, Props>(function input(
|
||||
props: Props,
|
||||
forwardedRef
|
||||
) {
|
||||
const [value, setValue] = useState('')
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -41,6 +44,7 @@ const Select = (props: Props) => {
|
|||
<RadixSelect.Trigger
|
||||
className={classNames('SelectTrigger', props.triggerClass)}
|
||||
placeholder={props.placeholder}
|
||||
ref={forwardedRef}
|
||||
>
|
||||
<RadixSelect.Value placeholder={props.placeholder} />
|
||||
<RadixSelect.Icon className="SelectIcon">
|
||||
|
|
@ -61,6 +65,6 @@ const Select = (props: Props) => {
|
|||
</RadixSelect.Portal>
|
||||
</RadixSelect.Root>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export default Select
|
||||
|
|
|
|||
Loading…
Reference in a new issue