aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/controls/TextControlService.hpp5
-rw-r--r--src/ui/render/TextRenderObject.cpp1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/controls/TextControlService.hpp b/src/ui/controls/TextControlService.hpp
index 376f9177..fe33f459 100644
--- a/src/ui/controls/TextControlService.hpp
+++ b/src/ui/controls/TextControlService.hpp
@@ -411,7 +411,10 @@ class TextControlService : public Object {
input_method_context_ =
GetUiApplication()->GetInputMethodManager()->GetContext(window);
input_method_context_->EnableIME();
- auto sync = [this](std::nullptr_t) { this->SyncTextRenderObject(); };
+ auto sync = [this](std::nullptr_t) {
+ this->SyncTextRenderObject();
+ ScrollToCaret();
+ };
input_method_context_->CompositionStartEvent()->AddHandler(
[this](std::nullptr_t) { this->DeleteSelectedText(); });
input_method_context_->CompositionEvent()->AddHandler(sync);
diff --git a/src/ui/render/TextRenderObject.cpp b/src/ui/render/TextRenderObject.cpp
index cecbe1f3..466c5084 100644
--- a/src/ui/render/TextRenderObject.cpp
+++ b/src/ui/render/TextRenderObject.cpp
@@ -43,6 +43,7 @@ std::u16string_view TextRenderObject::GetTextView() const {
void TextRenderObject::SetText(std::u16string new_text) {
text_layout_->SetText(std::move(new_text));
+ InvalidateLayout();
}
void TextRenderObject::SetBrush(