File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -267,10 +267,12 @@ $(() => {
267267 $tgt . focus ( ) ;
268268 } ;
269269
270- // If the word the caret is currently in starts with an @, and has at least 3 characters after that, assume it's
271- // an attempt to ping another user with a username, and kick off suggestions -- unless it starts with @#, in which
272- // case it's likely an already-selected ping.
273- if ( currentWord . startsWith ( '@' ) && ! currentWord . startsWith ( '@#' ) && currentWord . length >= 4 ) {
270+ // at least 1 character has to be present to trigger autocomplete (2 is because pings start with @)
271+ const hasReachedAutocompleteThreshold = currentWord . length >= 2 ;
272+
273+ // If the word the caret is currently in starts with an @, and is reached the autocomplete threshold, assume it's
274+ // a ping attempt and kick off suggestions (unless it starts with @#, meaning it's likely an already-selected ping)
275+ if ( currentWord . startsWith ( '@' ) && ! currentWord . startsWith ( '@#' ) && hasReachedAutocompleteThreshold ) {
274276 const threadId = $tgt . data ( 'thread' ) ;
275277 const postId = $tgt . data ( 'post' ) ;
276278
You can’t perform that action at this time.
0 commit comments