Skip to content

Commit

Permalink
ComboBox: fix ref bug issue with tags (#3928)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertCarreras authored Jan 7, 2025
1 parent 7e0f67e commit 662b183
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gestalt/src/TextField/InternalTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const InternalTextFieldWithForwardRef = forwardRef<HTMLInputElement, Props>(func

// When using both forwardRef and innerRefs, useimperativehandle() allows to externally set focus via the ref prop: textfieldRef.current.focus()
// @ts-expect-error - TS2322 - Type 'HTMLDivElement | HTMLInputElement | null' is not assignable to type 'HTMLInputElement'.
useImperativeHandle(ref, () => innerRef.current);
useImperativeHandle(ref, () => (tags ? innerTagsRef.current : innerRef.current));

// ==== STATE ====
const [focused, setFocused] = useState(false);
Expand Down

0 comments on commit 662b183

Please sign in to comment.