Passes along the autoFocus prop to Select

This passes along the autoFocus prop to the root Select component, and exposes it in SelectTableField
This commit is contained in:
Justin Edmund 2023-07-02 02:21:31 -07:00
parent 730bf0eac5
commit f9a8d1db5c
2 changed files with 3 additions and 4 deletions

View file

@ -5,7 +5,6 @@ import classNames from 'classnames'
import Overlay from '~components/common/Overlay'
import ChevronIcon from '~public/icons/Chevron.svg'
import styles from './index.module.scss'
// Props
@ -96,6 +95,7 @@ const Select = React.forwardRef<HTMLButtonElement, Props>(function select(
onOpenChange={props.onOpenChange}
>
<RadixSelect.Trigger
autoFocus={props.autoFocus || false}
className={triggerClasses}
placeholder={props.placeholder}
ref={forwardedRef}

View file

@ -1,11 +1,9 @@
import classNames from 'classnames'
import { useEffect, useState } from 'react'
import Select from '~components/common/Select'
import TableField from '~components/common/TableField'
import styles from './index.module.scss'
interface Props {
autoFocus?: boolean
name: string
label: string
description?: string
@ -38,6 +36,7 @@ const SelectTableField = (props: Props) => {
label={props.label}
>
<Select
autoFocus={props.autoFocus}
name={props.name}
open={props.open}
onOpenChange={props.onOpenChange}