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.

630 B
Raw Blame
import type { RefObject } from 'react'
import type { TextInput } from 'react-native'
import type { TerminalLiveInputSelection } from './terminal-live-text-commit'

// Unchanged controlled values need an imperative IME repair; RN Web refs are DOM nodes and require the platform sibling.
export function writeTerminalLiveInputText(
  ref: RefObject<TextInput | null>,
  text: string,
  selection?: TerminalLiveInputSelection
): void {
  ref.current?.setNativeProps({ text })
  if (selection) {
    // Fabric ignores collapsed selection props after replacing text.
    ref.current?.setSelection(selection.start, selection.end)
  }
}