From 8343256473d4858813eac5d8e60dafe93a46dd70 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Thu, 20 Jan 2022 21:00:09 +0400 Subject: [PATCH] Fix caret position after using autocomplete helper --- src/lib/richtextprocessor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/richtextprocessor.ts b/src/lib/richtextprocessor.ts index 951c5889..235748ed 100644 --- a/src/lib/richtextprocessor.ts +++ b/src/lib/richtextprocessor.ts @@ -538,7 +538,9 @@ namespace RichTextProcessor { // * check whether text was sliced // TODO: consider about moving it to other function if(entity.offset >= textLength) { - continue; + if(entity._ !== 'messageEntityCaret') { // * can set caret to the end + continue; + } } else if((entity.offset + entity.length) > textLength) { entity = copy(entity); entity.length = entity.offset + entity.length - textLength;