site: adjust cursor position after search autocompletion
This commit is contained in:
parent
6250bb9699
commit
b1cd0dad8d
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,10 @@ document.addEventListener('alpine:init', () => {
|
||||||
this.$refs.tags.value = mySplice(value, pos, this.query.length,
|
this.$refs.tags.value = mySplice(value, pos, this.query.length,
|
||||||
tag + ' ');
|
tag + ' ');
|
||||||
this.reset();
|
this.reset();
|
||||||
|
this.inputCursor =
|
||||||
|
this.$refs.tags.selectionStart =
|
||||||
|
this.$refs.tags.selectionEnd =
|
||||||
|
pos + tag.length + 1;
|
||||||
this.$refs.tags.focus();
|
this.$refs.tags.focus();
|
||||||
|
|
||||||
// Don't switch focus if we're completing after a Tab press.
|
// Don't switch focus if we're completing after a Tab press.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue