From a878888bd17d2fada1bdbc6c994f05e503c0171f Mon Sep 17 00:00:00 2001 From: Abhinav Agarwal Date: Wed, 2 Oct 2024 11:40:46 +0530 Subject: [PATCH] fix(input): sync the input state correctly --- packages/components/input/src/use-input.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/components/input/src/use-input.ts b/packages/components/input/src/use-input.ts index 26e0e15eff..c71ae47bb6 100644 --- a/packages/components/input/src/use-input.ts +++ b/packages/components/input/src/use-input.ts @@ -165,8 +165,10 @@ export function useInput { if (!domRef.current) return; + if (typeof ref == "function") ref(domRef as any); + setInputValue(domRef.current.value); - }, [domRef.current]); + }, [domRef.current, domRef.current?.value]); const { labelProps,