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

    Interface TextareaCaretRectHandle

    What useTextareaCaretRect returns.

    interface TextareaCaretRectHandle {
        caretAnchor(
            index?: number | (() => number),
            padding?: number | (() => number),
        ): { getBoundingClientRect(): CaretRect };
        getCaretRect(index?: number, padding?: number): CaretRect;
    }
    Index
    • A stable virtual element ({ getBoundingClientRect }) that re-measures on every read — pass it straight to a float anchor so the popup tracks the position as it moves. index may be a fixed number, a live getter (e.g. a token-start offset, so the popup anchors to the token rather than the caret), or omitted (follows selectionStart). padding (fixed or live) pulls the anchor left so a popup with its own left inset lines up flush under the offset.

      Parameters

      • Optionalindex: number | (() => number)
      • Optionalpadding: number | (() => number)

      Returns { getBoundingClientRect(): CaretRect }

    • Measure the caret rect now, at index (default: live selectionStart); padding pulls it left.

      Parameters

      • Optionalindex: number
      • Optionalpadding: number

      Returns CaretRect