mirror of
https://github.com/sim1222/misskey.git
synced 2025-08-07 09:13:52 +09:00
enhance(client): Improve emoji autocomplete behaviour
cherry picked from 4b2c215e25
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user