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(