setSelection EDITOR

setSelection API can be used to apply cursor selection on any content block using its path.

Syntax

setSelection(path : Array<Number>)

Example

1
2
3
4
5
6
7
8
9
import INKAPI from './inkapi.js'

INKAPI.ready(async () => {

  const EDITOR = INKAPI.editor;

  EDITOR.setSelection([2,1]);

});

Parameters

Name

Type

Description

path

Array<Number>

Required. Path of the block to be selected.

Note

Learn more about how blocks work in INK editor here.