From 533218d13aa2f1e0f955ee80daad55eba7952cdf Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Thu, 12 Sep 2024 05:10:27 +0200 Subject: [PATCH] Sync CaretIndex directly (#16981) --- src/Avalonia.Controls/TextBox.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index b12c23c597..aa8c239d27 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -411,6 +411,8 @@ namespace Avalonia.Controls var newValue = e.GetNewValue(); SetCurrentValue(SelectionStartProperty, newValue); SetCurrentValue(SelectionEndProperty, newValue); + + _presenter?.SetCurrentValue(TextPresenter.CaretIndexProperty, newValue); } ///