mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-25 00:49:17 +09:00
Fix #81
This commit is contained in:
parent
493dfd2118
commit
977df7f194
@ -152,9 +152,11 @@ class Autocomplete {
|
|||||||
this.text = trimmedBefore + '@' + value.username + ' ' + after;
|
this.text = trimmedBefore + '@' + value.username + ' ' + after;
|
||||||
|
|
||||||
// キャレットを戻す
|
// キャレットを戻す
|
||||||
|
this.vm.$nextTick(() => {
|
||||||
this.textarea.focus();
|
this.textarea.focus();
|
||||||
const pos = caret + value.username.length;
|
const pos = trimmedBefore.length + (value.username.length + 2);
|
||||||
this.textarea.setSelectionRange(pos, pos);
|
this.textarea.setSelectionRange(pos, pos);
|
||||||
|
});
|
||||||
} else if (type == 'emoji') {
|
} else if (type == 'emoji') {
|
||||||
const source = this.text;
|
const source = this.text;
|
||||||
|
|
||||||
@ -166,9 +168,11 @@ class Autocomplete {
|
|||||||
this.text = trimmedBefore + value + after;
|
this.text = trimmedBefore + value + after;
|
||||||
|
|
||||||
// キャレットを戻す
|
// キャレットを戻す
|
||||||
|
this.vm.$nextTick(() => {
|
||||||
this.textarea.focus();
|
this.textarea.focus();
|
||||||
const pos = caret + value.length;
|
const pos = trimmedBefore.length + 1;
|
||||||
this.textarea.setSelectionRange(pos, pos);
|
this.textarea.setSelectionRange(pos, pos);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user