Revert "fix(markdown): return focus to editor from find bar (#23175)" (#24500)

This reverts commit d9d5993cd5.
This commit is contained in:
Jinjing
2026-10-01 19:55:27 -07:00
committed by GitHub
parent 9f395208c8
commit 9e34bd06e7
@@ -35,14 +35,6 @@ function shouldFocusEmptyEditorFromSurfaceClick(
return !target.closest('.rich-markdown-editor-shell button, .rich-markdown-editor-shell input')
}
function shouldReturnFocusToEditor(event: React.MouseEvent<HTMLDivElement>): 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
}