From 26b24dfeecd8ab427215cd4b48e9b508cffbea9f Mon Sep 17 00:00:00 2001 From: Gregory <41027510+refactor256@users.noreply.github.com> Date: Thu, 26 Jan 2023 18:29:33 +0400 Subject: [PATCH] fix(TextInput): do not auto generate id for input if not needed (#505) --- src/components/TextInput/TextInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TextInput/TextInput.tsx b/src/components/TextInput/TextInput.tsx index 880fc912b..dbf8b1106 100644 --- a/src/components/TextInput/TextInput.tsx +++ b/src/components/TextInput/TextInput.tsx @@ -63,7 +63,7 @@ export const TextInput = React.forwardRef(funct const innerControlRef = React.useRef(null); const labelRef = React.useRef(null); const innerId = useUniqId(); - const id = originalId || innerId; + const id = label ? originalId || innerId : originalId; const [hasVerticalScrollbar, setHasVerticalScrollbar] = React.useState(false); const isControlled = value !== undefined;