Fix final offset

This commit is contained in:
pythongosssss
2023-10-01 13:00:26 +01:00
parent b477f2d7f3
commit 198297451e
+1 -1
View File
@@ -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;
}