]> cat aescling's git repositories - mastodon.git/commitdiff
Require at least 2 characters before showing autosuggestions (#5065)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 23 Sep 2017 22:33:17 +0000 (00:33 +0200)
committerGitHub <noreply@github.com>
Sat, 23 Sep 2017 22:33:17 +0000 (00:33 +0200)
app/javascript/mastodon/components/autosuggest_textarea.js

index daeb6fd53a731c915eac34e0142072d3726c0d9d..6f725885deea6095247b43b5dbcbe1d756912932 100644 (file)
@@ -20,7 +20,7 @@ const textAtCursorMatchesToken = (str, caretPosition) => {
     word = str.slice(left, right + caretPosition);
   }
 
-  if (!word || word.trim().length < 2 || ['@', ':'].indexOf(word[0]) === -1) {
+  if (!word || word.trim().length < 3 || ['@', ':'].indexOf(word[0]) === -1) {
     return [null, null];
   }