SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function createInputClipboardInjector

    • The input-clipboard resolve injector — copy / cut / paste / selectAll acting on the focused DOM editable (a text input / textarea / contenteditable), for Command.CommandResolver.addResolveInjector. Given (key, element) at resolve time it returns a leaf contribution (callback only) iff element is an editable and key is in the set — otherwise undefined, so the grid's cell copy resolves normally.

      Because the injected contribution is the most-specific (leaf), a focused input's copy out-resolves the grid clipboard (fixing "editing a formula, Copy grabs the cells"), and a region whose tree has no copy at all (the script editor) gains one (fixing "Copy disabled there") — both with no scope-tree surgery, and identically for the button and keystroke paths (both funnel through resolve). See design/COMMAND-INPUT-CLIPBOARD-PLAN.md.

      Clipboard data flows through our own clipboard (writeText/readText), not execCommand('copy') — so an input copy participates in the same clipboard the grid reads. execCommand is used only as the local text-edit primitive for paste-insert / cut-delete (it mutates the focused editable at the caret and fires a native input event, so a controlled React input picks up the change), with a setRangeText fallback.

      Parameters

      Returns ResolveInjector