From 662b183d4a85ffbcc5551e7acdb9e54365648c39 Mon Sep 17 00:00:00 2001 From: Alberto Carreras <10593890+AlbertCarreras@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:48:05 +0100 Subject: [PATCH] ComboBox: fix ref bug issue with tags (#3928) --- packages/gestalt/src/TextField/InternalTextField.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gestalt/src/TextField/InternalTextField.tsx b/packages/gestalt/src/TextField/InternalTextField.tsx index aba7758e16..3b47d56c1d 100644 --- a/packages/gestalt/src/TextField/InternalTextField.tsx +++ b/packages/gestalt/src/TextField/InternalTextField.tsx @@ -161,7 +161,7 @@ const InternalTextFieldWithForwardRef = forwardRef(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);