Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Rewording.
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Jun 22, 2018
1 parent d7e6fba commit 08b9a28
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/input.js
Expand Up @@ -139,8 +139,8 @@ export default class Input extends Plugin {
const buffer = inputCommand.buffer;
const isFlatSelection = doc.selection.rangeCount === 1 ? doc.selection.getFirstRange().isFlat : true;

// If on `compositionstart` there is a non-collapsed selection which start and end have different block
// parents it means the `_handleKeydown()` method did not remove its contents. It happens usually because
// If on `compositionstart` there is a non-collapsed selection which start and end have different parents
// it means the `_handleKeydown()` method did not remove its contents. It happens usually because
// of different order of events (`compositionstart` before `keydown` - in Safari). In such cases
// we need to remove selection contents on composition start (#83).
if ( doc.selection.isCollapsed || isFlatSelection ) {
Expand All @@ -162,9 +162,8 @@ export default class Input extends Plugin {
* @private
*/
_handleCompositionend() {
// Store current selection on `compositionend`. It is then used in `_handleKeydown()` method
// for browsers (Safari) which fire `keydown` event after (and not before) `compositionend`
// to detect if selection content should be removed (#83).
// Store current selection on `compositionend`. It is then used in `_handleKeydown()`
// method to detect if selection content should be removed (#83).
this._latestCompositionSelection = new Selection( this.editor.model.document.selection );
}

Expand Down

0 comments on commit 08b9a28

Please sign in to comment.