MCPcopy
hub / github.com/codex-team/editor.js / setCursor

Method setCursor

src/components/domIterator.ts:68–74  ·  view source on GitHub ↗

* Sets cursor to specified position * * @param cursorPosition - new cursor position

(cursorPosition: number)

Source from the content-addressed store, hash-verified

66 * @param cursorPosition - new cursor position
67 */
68 public setCursor(cursorPosition: number): void {
69 if (cursorPosition < this.items.length && cursorPosition >= -1) {
70 this.dropCursor();
71 this.cursor = cursorPosition;
72 this.items[this.cursor].classList.add(this.focusedCssClass);
73 }
74 }
75
76 /**
77 * Sets items. Can be used when iterable items changed dynamically

Callers 3

activateMethod · 0.45
setMethod · 0.45

Calls 2

dropCursorMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected