From 9e34bd06e7fea7b0d0ec20dcf5bfd97c2db92984 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 1 Oct 2026 19:55:27 -0700 Subject: [PATCH] Revert "fix(markdown): return focus to editor from find bar (#23175)" (#24500) This reverts commit d9d5993cd5a0ea59070b13548754fec2671620e6. --- .../components/editor/RichMarkdownEditorSurface.tsx | 13 ------------- 1 file changed, 13 deletions(-) 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 }