Skip to content

Commit

Permalink
Update InlineAutocomplete after merging main
Browse files Browse the repository at this point in the history
  • Loading branch information
iansan5653 authored Aug 2, 2022
1 parent ff8e1c1 commit 9aa7fda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/drafts/InlineAutocomplete/InlineAutocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {cloneElement, useRef} from 'react'
import Box from '../../Box'
import {useCombinedRefs} from '../../hooks/useCombinedRefs'
import {useSyntheticChange} from '../hooks/useSyntheticChange'
import Portal from '../../Portal'
import {BetterSystemStyleObject} from '../../sx'
Expand All @@ -14,6 +13,7 @@ import {
requireChildrenToBeInput
} from './utils'
import AutocompleteSuggestions from './_AutocompleteSuggestions'
import {useRefObjectAsForwardedRef} from '../../hooks'

export type InlineAutocompleteProps = {
/** Register the triggers that can cause suggestions to appear. */
Expand Down Expand Up @@ -86,7 +86,9 @@ const InlineAutocomplete = ({
// Forward accessibility props so it works with FormControl
...forwardProps
}: InlineAutocompleteProps & React.ComponentProps<'textarea' | 'input'>) => {
const inputRef = useCombinedRefs(children.ref)
const inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null)
useRefObjectAsForwardedRef(children.ref, inputRef)

const externalInput = requireChildrenToBeInput(children, inputRef)

const emitSyntheticChange = useSyntheticChange({
Expand Down

0 comments on commit 9aa7fda

Please sign in to comment.