From 3b06845a7125f3019212a7fc1a66d02bcb7125e3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 22 Sep 2025 18:52:41 +0300 Subject: [PATCH] fix(board): unable to create by clicking outside --- apps/client/src/widgets/collections/board/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsx index c99a6f1a0..2e8add6b4 100644 --- a/apps/client/src/widgets/collections/board/index.tsx +++ b/apps/client/src/widgets/collections/board/index.tsx @@ -228,7 +228,7 @@ export function TitleEditor({ currentValue, placeholder, save, dismiss, multilin }) { const inputRef = useRef(null); const dismissOnNextRefreshRef = useRef(false); - const shouldSave = useRef(false); + const shouldDismiss = useRef(false); useEffect(() => { inputRef.current?.focus(); @@ -254,12 +254,12 @@ export function TitleEditor({ currentValue, placeholder, save, dismiss, multilin onKeyDown={(e: TargetedKeyboardEvent) => { if (e.key === "Enter" || e.key === "Escape") { e.preventDefault(); - shouldSave.current = (e.key === "Enter"); + shouldDismiss.current = (e.key === "Escape"); e.currentTarget.blur(); } }} onBlur={(newValue) => { - if (shouldSave.current && newValue.trim() && (newValue !== currentValue || isNewItem)) { + if (!shouldDismiss.current && newValue.trim() && (newValue !== currentValue || isNewItem)) { save(newValue); dismissOnNextRefreshRef.current = true; } else {