diff --git a/src/renderer/src/components/editor/RichMarkdownEditorSurface.tsx b/src/renderer/src/components/editor/RichMarkdownEditorSurface.tsx index 6c71a126ecd..8e2ca1e4abb 100644 --- a/src/renderer/src/components/editor/RichMarkdownEditorSurface.tsx +++ b/src/renderer/src/components/editor/RichMarkdownEditorSurface.tsx @@ -35,14 +35,6 @@ function shouldFocusEmptyEditorFromSurfaceClick( return !target.closest('.rich-markdown-editor-shell button, .rich-markdown-editor-shell input') } -function shouldReturnFocusToEditor(event: React.MouseEvent): boolean { - if (event.button !== 0) { - return false - } - const target = event.target - return target instanceof Element && Boolean(target.closest('.ProseMirror')) -} - type RichMarkdownEditorSurfaceProps = { editor: Editor | null editorFontZoomLevel: number @@ -217,11 +209,6 @@ export function RichMarkdownEditorSurface({ // Image layout must not anchor-scroll over the restored tab position. className="relative h-full overflow-auto scrollbar-editor [overflow-anchor:none]" onMouseDown={(event) => { - if (shouldReturnFocusToEditor(event)) { - // Keep the find bar open while handing keyboard focus back to the document. - searchState.searchInputRef.current?.blur() - editor?.commands.focus() - } if (!shouldFocusEmptyEditorFromSurfaceClick(event, editor)) { return }