From 7b5df7f8033d372d3b7d0fa874e0b797a627ab60 Mon Sep 17 00:00:00 2001 From: paal2707 <68380161+paal2707@users.noreply.github.com> Date: Fri, 24 May 2024 09:21:00 +0200 Subject: [PATCH] fix(Textfield): character counter inital value (#2056) --- packages/react/src/components/form/Textfield/Textfield.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/form/Textfield/Textfield.tsx b/packages/react/src/components/form/Textfield/Textfield.tsx index e7c69af994..589d92e63c 100644 --- a/packages/react/src/components/form/Textfield/Textfield.tsx +++ b/packages/react/src/components/form/Textfield/Textfield.tsx @@ -92,7 +92,7 @@ export const Textfield = forwardRef( readOnly, } = useTextfield(props); - const [inputValue, setInputValue] = useState(props.defaultValue); + const [inputValue, setInputValue] = useState(props.value || props.defaultValue); const characterLimitId = `textfield-charactercount-${useId()}`; const hasCharacterLimit = characterLimit != null;