diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-21 10:29:26 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-21 10:29:26 +0900 |
| commit | 04855f920144cd3d040d9896157f186c1ceebc88 (patch) | |
| tree | 1e06ad046c5717f6d9486d7862371797e1d7a89c /src/client/scripts | |
| parent | perf: Tune AP job queue timings (#7635) (diff) | |
| download | sharkey-04855f920144cd3d040d9896157f186c1ceebc88.tar.gz sharkey-04855f920144cd3d040d9896157f186c1ceebc88.tar.bz2 sharkey-04855f920144cd3d040d9896157f186c1ceebc88.zip | |
enhance(client): Improve emoji autocomplete behaviour
cherry picked from https://github.com/kat-atat/misskey/commit/4b2c215e25a0bae47f4375b296d1f5d07a179f88
Diffstat (limited to 'src/client/scripts')
| -rw-r--r-- | src/client/scripts/autocomplete.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/scripts/autocomplete.ts b/src/client/scripts/autocomplete.ts index 99c54c69c5..924d6a62ee 100644 --- a/src/client/scripts/autocomplete.ts +++ b/src/client/scripts/autocomplete.ts @@ -65,7 +65,7 @@ export class Autocomplete { */ private onInput() { const caretPos = this.textarea.selectionStart; - const text = this.text.substr(0, caretPos).split('\n').pop(); + const text = this.text.substr(0, caretPos).split('\n').pop()!; const mentionIndex = text.lastIndexOf('@'); const hashtagIndex = text.lastIndexOf('#'); @@ -83,7 +83,7 @@ export class Autocomplete { const isMention = mentionIndex != -1; const isHashtag = hashtagIndex != -1; - const isEmoji = emojiIndex != -1; + const isEmoji = emojiIndex != -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':'); let opened = false; |