From 44dec297e123df157a803f52a73fe618702fd737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Salavisa?= Date: Fri, 24 Apr 2026 11:45:39 +0100 Subject: [PATCH] fix(web): apply initialValues when TaskCreateDialog mounts already-open (#688) --- apps/web/components/task-create-dialog-state.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/components/task-create-dialog-state.ts b/apps/web/components/task-create-dialog-state.ts index eca1eadac3..b09f33b3b0 100644 --- a/apps/web/components/task-create-dialog-state.ts +++ b/apps/web/components/task-create-dialog-state.ts @@ -255,7 +255,9 @@ function useFormStateValues( ) { // openCycle increments each time dialog opens - used in key to force TaskFormInputs remount const [openCycle, setOpenCycle] = useState(0); - const prevOpenRef = useRef(open); + // Start as false so a fresh mount with open=true is detected as a rising edge + // (callers like QuickTaskLauncher conditionally mount the dialog already-open). + const prevOpenRef = useRef(false); // currentDefaults stores the loaded draft/initial values for this open cycle const [currentDefaults, setCurrentDefaults] = useState<{ name: string; description: string }>({