MCPcopy Create free account
hub / github.com/anomalyco/opencode / isEditableTarget

Function isEditableTarget

packages/app/src/context/command.tsx:235–241  ·  view source on GitHub ↗
(target: EventTarget | null)

Source from the content-addressed store, hash-verified

233}
234
235function isEditableTarget(target: EventTarget | null) {
236 if (!(target instanceof HTMLElement)) return false
237 if (target.isContentEditable) return true
238 if (target.closest("[contenteditable='true']")) return true
239 if (target.closest("input, textarea, select")) return true
240 return false
241}
242
243export const { use: useCommand, provider: CommandProvider } = createSimpleContext({
244 name: "Command",

Callers 1

handleKeyDownFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected