Skip to main content

$removeTextFromCaretRange

function

Remove all text and nodes in the given range. If the range spans multiple blocks then the remaining contents of the later block will be merged with the earlier block.

function $removeTextFromCaretRange<D extends CaretDirection>(initialRange: CaretRange<D>, sliceMode?: 'removeEmptySlices' | 'preserveEmptyTextSliceCaret'): CaretRange<D>

Import

import { $removeTextFromCaretRange } from '@modular/sdk/editor';

Notes

returns
The new collapsed range (biased towards the earlier node)