From aef62d135684660673a20d803ab06ef391e1a9b7 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 10 Jul 2022 10:23:00 +0200 Subject: [PATCH] fix: Publish click from editing heading, closes #3759 --- app/scenes/Document/components/Editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scenes/Document/components/Editor.tsx b/app/scenes/Document/components/Editor.tsx index 666dd769f..0401a355b 100644 --- a/app/scenes/Document/components/Editor.tsx +++ b/app/scenes/Document/components/Editor.tsx @@ -57,8 +57,10 @@ function DocumentEditor(props: Props, ref: React.RefObject) { } }, [ref]); + // Save document when blurring title, but delay so that if clicking on a + // button this is allowed to execute first. const handleBlur = React.useCallback(() => { - props.onSave({ autosave: true }); + setTimeout(() => props.onSave({ autosave: true }), 250); }, [props]); const handleGoToNextInput = React.useCallback(