8
0
Просмотр исходного кода

Add internal docs to MentionUI.

Maciej Gołaszewski 6 лет назад
Родитель
Сommit
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 => {
 				.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;
 						return;
 					}
 					}