From bf51dd442df99b5dc360ffe97183abc26054193a Mon Sep 17 00:00:00 2001 From: Ramnique Singh <30795890+ramnique@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:08:31 +0530 Subject: [PATCH] fix copilot compose text bug --- apps/rowboat/components/ui/textarea.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/rowboat/components/ui/textarea.tsx b/apps/rowboat/components/ui/textarea.tsx index 01bd61a6..e3ac1390 100644 --- a/apps/rowboat/components/ui/textarea.tsx +++ b/apps/rowboat/components/ui/textarea.tsx @@ -35,6 +35,11 @@ export const Textarea = forwardRef(({ const [validationError, setValidationError] = useState(); const [isEditing, setIsEditing] = useState(false); + // update local value when prop value changes + useEffect(() => { + setLocalValue(propValue as string); + }, [propValue]); + // Sync local state with prop value when not editing useEffect(() => { if (!isEditing) {