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

Commit

Permalink
WIP #4533
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik committed Nov 8, 2019
1 parent 8f33684 commit b817306
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export default class Renderer {
*/
this.isFocused = false;

/**
* Indicates if the view document is composing.
*
* @member {Boolean}
*/
this.isComposing = false;

/**
* The text node in which the inline filler was rendered.
*
Expand Down Expand Up @@ -762,6 +769,11 @@ export default class Renderer {
* @returns {Boolean}
*/
_domSelectionNeedsUpdate( domSelection ) {
// Remain DOM selection untouched while composing (#1782)
if ( this.isComposing ) {
return false;
}

if ( !this.domConverter.isDomSelectionCorrect( domSelection ) ) {
// Current DOM selection is in incorrect position. We need to update it.
return true;
Expand Down
1 change: 1 addition & 0 deletions src/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default class View {
*/
this._renderer = new Renderer( this.domConverter, this.document.selection );
this._renderer.bind( 'isFocused' ).to( this.document );
this._renderer.bind( 'isComposing' ).to( this.document );

/**
* A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
Expand Down

0 comments on commit b817306

Please sign in to comment.