Skip to main content

$getCaretRangeInDirection

function

Return the range if it's in the given direction, otherwise construct a new range using a flipped focus as the anchor and a flipped anchor as the focus. This transformation preserves the section of the document that it's working with, but reverses the order of iteration.

function $getCaretRangeInDirection<D extends CaretDirection>(range: CaretRange<CaretDirection>, direction: D): CaretRange<D>

Import

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

Notes

returns
A CaretRange in direction