Skip to content

Commit

Permalink
fix(input): sync the input state correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav700 committed Oct 2, 2024
1 parent 7134996 commit a878888
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/input/src/use-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
useSafeLayoutEffect(() => {
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,
Expand Down

0 comments on commit a878888

Please sign in to comment.