Skip to main content

SELECTION_CHANGE_COMMAND

const

Dispatched in an update, before reconciliation, when the selection changes. $getSelection() is the pending selection; $getPreviousSelection() is the last committed selection. Listeners may modify the pending update. The DOM is not guaranteed to match it: use $onUpdate(() => editor.read('latest', ...)) for DOM-dependent work, including element lookup, focus checks and positioning.

const SELECTION_CHANGE_COMMAND: LexicalCommand<void>

Import

import { SELECTION_CHANGE_COMMAND } from '@modular/sdk/editor';