Merge "Username completions: always abandon if the first input is a space"

This commit is contained in:
jenkins-bot 2023-05-20 16:13:42 +00:00 committed by Gerrit Code Review
commit 042f1919d1

View file

@ -231,7 +231,12 @@ MWUsernameCompletionAction.prototype.insertCompletion = function ( word, range )
MWUsernameCompletionAction.prototype.shouldAbandon = function ( input ) { MWUsernameCompletionAction.prototype.shouldAbandon = function ( input ) {
// TODO: need to consider whether pending loads from server are happening here // TODO: need to consider whether pending loads from server are happening here
return MWUsernameCompletionAction.super.prototype.shouldAbandon.apply( this, arguments ) && input.split( /\s+/ ).length > 2; return MWUsernameCompletionAction.super.prototype.shouldAbandon.apply( this, arguments ) && (
// Abandon if the user hit space immediately
input.match( /^\s+$/ ) ||
// Abandon if there's more than two words entered without a match
input.split( /\s+/ ).length > 2
);
}; };
/* Registration */ /* Registration */