Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

570 B
Raw Blame
import { rememberSelection } from './editor-selection'
import { editorElement } from './editor-surface'
import type { RichMarkdownEditorScope } from './document-scope'

// Save caret before blur closes keyboard because WebKit drops DOM selection; flag tells next command to restore saved range.
export function dismissKeyboard(scope: RichMarkdownEditorScope) {
  rememberSelection(scope)
  scope.selectionDroppedOnBlur = true
  const active = scope.getDocument().activeElement
  if (active instanceof HTMLElement) {
    active.blur()
  }
  editorElement(scope).blur()
}