From 198297451e4e9dba41699aa446510c11d7b81a2a Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:00:26 +0100 Subject: [PATCH] Fix final offset --- web/js/common/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }