From 45fc13a43e49401c14026c4f6f1422e5d159d96d Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 29 Sep 2024 20:53:40 +0200 Subject: [PATCH] Fixed an issue where pressing the 'Clear' button in the text editor and then entering some value in the input field crashed the application --- es-core/src/components/TextEditComponent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/es-core/src/components/TextEditComponent.cpp b/es-core/src/components/TextEditComponent.cpp index b33b685a8..360559b56 100644 --- a/es-core/src/components/TextEditComponent.cpp +++ b/es-core/src/components/TextEditComponent.cpp @@ -344,6 +344,9 @@ void TextEditComponent::onTextChanged() if (mCursor > static_cast(mText.length())) mCursor = static_cast(mText.length()); + + if (mCursorShapedText > static_cast(Utils::String::unicodeLength(mText))) + mCursorShapedText = static_cast(Utils::String::unicodeLength(mText)); } void TextEditComponent::onCursorChanged()