File tree Expand file tree Collapse file tree
packages/components/src/spectrum/comboBox Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React from 'react' ;
12import {
23 ComboBox as SpectrumComboBox ,
34 SpectrumComboBoxProps ,
@@ -9,24 +10,19 @@ import { PickerPropsT, usePickerProps } from '../picker';
910
1011export type ComboBoxProps = PickerPropsT < SpectrumComboBoxProps < NormalizedItem > > ;
1112
12- export function ComboBox ( {
13- UNSAFE_className,
14- ...props
15- } : ComboBoxProps ) : JSX . Element {
16- const {
17- defaultSelectedKey,
18- disabledKeys,
19- ref,
20- selectedKey,
21- ...comboBoxProps
22- } = usePickerProps ( props ) ;
13+ export const ComboBox = React . forwardRef ( function ComboBox (
14+ { UNSAFE_className, ...props } : ComboBoxProps ,
15+ ref : FocusableRef < HTMLElement >
16+ ) : JSX . Element {
17+ const { defaultSelectedKey, disabledKeys, selectedKey, ...comboBoxProps } =
18+ usePickerProps ( props ) ;
2319
2420 return (
2521 < SpectrumComboBox
2622 // eslint-disable-next-line react/jsx-props-no-spreading
2723 { ...comboBoxProps }
2824 UNSAFE_className = { cl ( 'dh-combobox' , UNSAFE_className ) }
29- ref = { ref as FocusableRef < HTMLElement > }
25+ ref = { ref }
3026 // Type assertions are necessary here since Spectrum types don't account
3127 // for number and boolean key values even though they are valid runtime
3228 // values.
@@ -41,4 +37,4 @@ export function ComboBox({
4137 }
4238 />
4339 ) ;
44- }
40+ } ) ;
You can’t perform that action at this time.
0 commit comments