mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Username completions: always abandon if the first input is a space
This has been added to the core behavior of shouldAbandon as well, but the way it's overridden here needs to be changed since the multiple-words check would override that. Depends-On: If130cdc1df595e6ab12d531ce603cc42c8b3b5f3 Change-Id: Ie7bdc4a4702514fcb7d500924dad18729198b9e8
This commit is contained in:
parent
4bcee681fc
commit
5568761377
|
@ -231,7 +231,12 @@ MWUsernameCompletionAction.prototype.insertCompletion = function ( word, range )
|
|||
|
||||
MWUsernameCompletionAction.prototype.shouldAbandon = function ( input ) {
|
||||
// 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 */
|
||||
|
|
Loading…
Reference in a new issue