Преглед изворни кода

Add internal docs to MentionUI.

Maciej Gołaszewski пре 6 година
родитељ
комит
5b92bf09e7
1 измењених фајлова са 4 додато и 5 уклоњено
  1. 4 5
      packages/ckeditor5-mention/src/mentionui.js

+ 4 - 5
packages/ckeditor5-mention/src/mentionui.js

@@ -364,11 +364,10 @@ export default class MentionUI extends Plugin {
 					} );
 				} )
 				.then( feed => {
-					if ( !feed ) {
-						return;
-					}
-
-					if ( !this.editor.model.markers.has( 'mention' ) ) {
+					// Do nothing if :
+					// - feed was discarded or empty feed was passed.
+					// - if the marker is not in the document - the selection might have already changed.
+					if ( !feed || !this.editor.model.markers.has( 'mention' ) ) {
 						return;
 					}