feat: require at least two characters to autocomplete emoji (#298)

This commit is contained in:
bree 2021-10-31 18:36:38 -04:00 committed by GitHub
parent 3ef3f84877
commit 1800aace43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,9 @@ export function useAutoComplete(
if (current === ":" || current === "@" || current === "#") {
const search = content.slice(j + 1, content.length);
if (search.length > 0) {
const minLen = current === ":" ? 2 : 1
if (search.length >= minLen) {
return [
current === "#"
? "channel"