diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 1ace0962e8d2..2b282c239bbf 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -438,6 +438,7 @@ Map { }, }, "ComboBox" => Object { + "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { "ariaLabel": "Choose an item", "direction": "bottom", @@ -692,6 +693,7 @@ Map { "type": "node", }, }, + "render": [Function], }, "ComposedModal" => Object { "defaultProps": Object { diff --git a/packages/react/src/components/ComboBox/ComboBox.js b/packages/react/src/components/ComboBox/ComboBox.js index 30a4b6c283f2..f274d16cb222 100644 --- a/packages/react/src/components/ComboBox/ComboBox.js +++ b/packages/react/src/components/ComboBox/ComboBox.js @@ -70,7 +70,7 @@ const findHighlightedIndex = ({ items, itemToString }, inputValue) => { const getInstanceId = setupGetInstanceId(); -const ComboBox = (props) => { +const ComboBox = React.forwardRef((props, ref) => { const { ariaLabel, className: containerClassName, @@ -308,7 +308,7 @@ const ComboBox = (props) => { aria-controls={inputProps['aria-controls']} {...inputProps} {...rest} - ref={mergeRefs(textInput, rootProps.ref)} + ref={mergeRefs(textInput, ref)} /> {invalid && ( { }} ); -}; +}); ComboBox.propTypes = { /**