mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 20:07:33 -07:00
Fix #81
This commit is contained in:
parent
98339b3527
commit
d94935c32d
1 changed files with 10 additions and 6 deletions
|
@ -152,9 +152,11 @@ class Autocomplete {
|
|||
this.text = trimmedBefore + '@' + value.username + ' ' + after;
|
||||
|
||||
// キャレットを戻す
|
||||
this.textarea.focus();
|
||||
const pos = caret + value.username.length;
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
this.vm.$nextTick(() => {
|
||||
this.textarea.focus();
|
||||
const pos = trimmedBefore.length + (value.username.length + 2);
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
});
|
||||
} else if (type == 'emoji') {
|
||||
const source = this.text;
|
||||
|
||||
|
@ -166,9 +168,11 @@ class Autocomplete {
|
|||
this.text = trimmedBefore + value + after;
|
||||
|
||||
// キャレットを戻す
|
||||
this.textarea.focus();
|
||||
const pos = caret + value.length;
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
this.vm.$nextTick(() => {
|
||||
this.textarea.focus();
|
||||
const pos = trimmedBefore.length + 1;
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue