Skip to content

Commit

Permalink
Updated code comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
niegowski committed Apr 25, 2024
1 parent da0b502 commit d812da8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ export default class SelectionObserver extends Observer {
this._documentIsSelectingInactivityTimeoutDebounced();
} );

// On composition start upcast the selection, so it includes composed text to be replaced on composition end.
// Update the model DocumentSelection just after the Renderer and the SelectionObserver are locked.
// We do this synchronously (without waiting for the `selectionchange` DOM event) as browser updates
// the DOM selection (but not visually) to span the text that is under composition and could be replaced.
this.listenTo<ViewDocumentCompositionStartEvent>( this.view.document, 'compositionstart', () => {
this._handleSelectionChange( domDocument );
}, { priority: 'lowest' } );
Expand Down

0 comments on commit d812da8

Please sign in to comment.