mirror of
https://github.com/stablyai/orca.git
synced 2026-10-02 16:02:15 +00:00
This reverts commit d9d5993cd5.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user