set-selection

How to get set-selection

Depend on fontoxml-base-flow to make this operation available.

Place the selection at the given positions.

Imported operation data

Name Type Description
selectionRange Object

The new range

selectionRange.startContainerNodeId NodeId

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

selectionRange.startOffset Number

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

selectionRange.endContainerNodeId NodeId

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

selectionRange.endOffset Number

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

selectionIsBackwards 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

[hierarchyNodeId] HierarchyNodeId

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.

Was this page helpful?