Explorar o código

Add internal docs to MentionUI.

Maciej Gołaszewski %!s(int64=6) %!d(string=hai) anos
pai
achega
5b92bf09e7
Modificáronse 1 ficheiros con 4 adicións e 5 borrados
  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;
 					}