parent
86fcd3a378
commit
c21caad1c5
7 changed files with 91 additions and 8 deletions
|
|
@ -222,13 +222,15 @@ class Autocomplete {
|
|||
const trimmedBefore = before.substring(0, before.lastIndexOf(':'));
|
||||
const after = source.substr(caret);
|
||||
|
||||
if (value.startsWith(':')) value = value + ' ';
|
||||
|
||||
// 挿入
|
||||
this.text = trimmedBefore + value + after;
|
||||
|
||||
// キャレットを戻す
|
||||
this.vm.$nextTick(() => {
|
||||
this.textarea.focus();
|
||||
const pos = trimmedBefore.length + 1;
|
||||
const pos = trimmedBefore.length + (value.startsWith(':') ? value.length : 1);
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue