mirror of
https://github.com/revoltchat/revite.git
synced 2025-02-21 07:42:52 -05:00
feat: require at least two characters to autocomplete emoji (#298)
This commit is contained in:
parent
3ef3f84877
commit
1800aace43
1 changed files with 23 additions and 21 deletions
|
@ -79,7 +79,9 @@ export function useAutoComplete(
|
||||||
|
|
||||||
if (current === ":" || current === "@" || current === "#") {
|
if (current === ":" || current === "@" || current === "#") {
|
||||||
const search = content.slice(j + 1, content.length);
|
const search = content.slice(j + 1, content.length);
|
||||||
if (search.length > 0) {
|
const minLen = current === ":" ? 2 : 1
|
||||||
|
|
||||||
|
if (search.length >= minLen) {
|
||||||
return [
|
return [
|
||||||
current === "#"
|
current === "#"
|
||||||
? "channel"
|
? "channel"
|
||||||
|
|
Loading…
Add table
Reference in a new issue