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

Method addFakeCursor

src/components/selection.ts:372–385  ·  view source on GitHub ↗

* Adds fake cursor to the current range

()

Source from the content-addressed store, hash-verified

370 * Adds fake cursor to the current range
371 */
372 public static addFakeCursor(): void {
373 const range = SelectionUtils.range;
374
375 if (range === null) {
376 return;
377 }
378
379 const fakeCursor = $.make('span', 'codex-editor__fake-cursor');
380
381 fakeCursor.dataset.mutationFree = 'true';
382
383 range.collapse();
384 range.insertNode(fakeCursor);
385 }
386
387 /**
388 * Check if passed element contains a fake cursor

Callers 1

selectedMethod · 0.80

Calls 1

makeMethod · 0.45

Tested by

no test coverage detected