diff --git a/web/js/common/autocomplete.js b/web/js/common/autocomplete.js index 6c169ae..ecfea7b 100644 --- a/web/js/common/autocomplete.js +++ b/web/js/common/autocomplete.js @@ -291,8 +291,7 @@ class TextAreaCaretHelper { this.el.value = this.el.value.substring(0, startPos + offset) + value + this.el.value.substring(endPos, this.el.value.length); - this.el.selectionStart = startPos + value.length; - this.el.selectionEnd = startPos + value.length; + this.el.selectionEnd = this.el.selectionStart = startPos + value.length + offset; } else { this.el.value += value; } @@ -395,6 +394,8 @@ export class TextAreaAutoComplete { this.#hide(); break; } + } else if (e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "ArrowLeft" || e.key === "ArrowRight") { + return; } if (!e.defaultPrevented) { this.#update();