Exclude arrows from triggering
Fix insert selection offset
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user