set-selection

Type: Operation

Place the selection at the given positions.

Imported operation data

  1. selectionRange

    (Required)

    Type: Object

    The new range

  2. selectionRange.startContainerNodeId

    (Required)

    Type: NodeId

    The start container of the range. Should always be before the end container, in document order.

  3. selectionRange.startOffset

    (Required)

    Type: Number

    Index among the start container's childNodes or characters (if it is a text node) at which to start the selection.

  4. selectionRange.endContainerNodeId

    (Required)

    Type: NodeId

    The end container of the range. Should always be after the start container, in DOM order.

  5. selectionRange.endOffset

    (Required)

    Type: Number

    Index among the end container's childNodes or characters (if it is a text node) at which to end the selection.

  6. selectionIsBackwards

    (Required)

    Type: Boolean

    Use this option to set the direction of the selection explicitly. Note that using this property does not influence the fact that the start position should be before the end position

  7. [hierarchyNodeId]

    (Required)

    Optionally, provide the hierarchy node ID under which to consider this selection. This is used in cases where a document appears in the hierarchy multiple times. If omitted, Fonto prefers the same hierarchy node as the current (if the selection is in the same sheet frame), the sheet frame that most recently had the cursor in it, or the first occurrence in the DocumentsHierarchy.