diff --git a/web/js/common/autocomplete.js b/web/js/common/autocomplete.js index 096b58c..a8f232e 100644 --- a/web/js/common/autocomplete.js +++ b/web/js/common/autocomplete.js @@ -291,7 +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.selectionEnd = this.el.selectionStart = startPos + value.length + offset + finalOffset; + this.el.selectionEnd = this.el.selectionStart = startPos + value.length + offset + (finalOffset ?? 0); } else { this.el.value += value; }