Browse Source

Other: `DocumentSelection#event:change:marker` should be fired just after a selection range change, like `event:change:attribute`.

Szymon Cofalik 5 years ago
parent
commit
3c25c6303a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/ckeditor5-engine/src/model/documentselection.js

+ 3 - 1
packages/ckeditor5-engine/src/model/documentselection.js

@@ -733,11 +733,13 @@ class LiveSelection extends Selection {
 	setTo( selectable, optionsOrPlaceOrOffset, options ) {
 		super.setTo( selectable, optionsOrPlaceOrOffset, options );
 		this._updateAttributes( true );
+		this._updateMarkers();
 	}
 
 	setFocus( itemOrPosition, offset ) {
 		super.setFocus( itemOrPosition, offset );
 		this._updateAttributes( true );
+		this._updateMarkers();
 	}
 
 	setAttribute( key, value ) {
@@ -873,7 +875,7 @@ class LiveSelection extends Selection {
 		}
 
 		if ( changed ) {
-			this.fire( 'change:marker', { oldMarkers } );
+			this.fire( 'change:marker', { oldMarkers, directChange: false } );
 		}
 	}