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:
parent
730bf0eac5
commit
f9a8d1db5c
2 changed files with 3 additions and 4 deletions
|
|
@ -5,7 +5,6 @@ import classNames from 'classnames'
|
||||||
import Overlay from '~components/common/Overlay'
|
import Overlay from '~components/common/Overlay'
|
||||||
|
|
||||||
import ChevronIcon from '~public/icons/Chevron.svg'
|
import ChevronIcon from '~public/icons/Chevron.svg'
|
||||||
|
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
|
|
@ -96,6 +95,7 @@ const Select = React.forwardRef<HTMLButtonElement, Props>(function select(
|
||||||
onOpenChange={props.onOpenChange}
|
onOpenChange={props.onOpenChange}
|
||||||
>
|
>
|
||||||
<RadixSelect.Trigger
|
<RadixSelect.Trigger
|
||||||
|
autoFocus={props.autoFocus || false}
|
||||||
className={triggerClasses}
|
className={triggerClasses}
|
||||||
placeholder={props.placeholder}
|
placeholder={props.placeholder}
|
||||||
ref={forwardedRef}
|
ref={forwardedRef}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
import classNames from 'classnames'
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import Select from '~components/common/Select'
|
import Select from '~components/common/Select'
|
||||||
import TableField from '~components/common/TableField'
|
import TableField from '~components/common/TableField'
|
||||||
|
|
||||||
import styles from './index.module.scss'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
autoFocus?: boolean
|
||||||
name: string
|
name: string
|
||||||
label: string
|
label: string
|
||||||
description?: string
|
description?: string
|
||||||
|
|
@ -38,6 +36,7 @@ const SelectTableField = (props: Props) => {
|
||||||
label={props.label}
|
label={props.label}
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
|
autoFocus={props.autoFocus}
|
||||||
name={props.name}
|
name={props.name}
|
||||||
open={props.open}
|
open={props.open}
|
||||||
onOpenChange={props.onOpenChange}
|
onOpenChange={props.onOpenChange}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue