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

Commit

Permalink
Moved selection reset leftover out of the loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Jan 11, 2019
1 parent 38e02d1 commit d10c072
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/controller/datacontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,12 @@ export default class DataController {

this.model.enqueueChange( 'transparent', writer => {
writer.setSelection( null );
writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );

for ( const rootName of Object.keys( newData ) ) {
// Save to model.
const modelRoot = this.model.document.getRoot( rootName );

writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );

writer.remove( writer.createRangeIn( modelRoot ) );
writer.insert( this.parse( newData[ rootName ], modelRoot ), modelRoot, 0 );
}
Expand Down

0 comments on commit d10c072

Please sign in to comment.