From 3c2c95d670b0419f2b4b264d643ff30d386a9650 Mon Sep 17 00:00:00 2001 From: stefnotch Date: Sat, 24 Apr 2021 10:30:08 +0200 Subject: [PATCH] Fix textbox selection when deleting See https://forum.flaxengine.com/t/renaming-items-in-the-content-area-problem/334 --- Source/Engine/UI/GUI/Common/TextBoxBase.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Common/TextBoxBase.cs b/Source/Engine/UI/GUI/Common/TextBoxBase.cs index ac0b3b55f..e771adb8b 100644 --- a/Source/Engine/UI/GUI/Common/TextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/TextBoxBase.cs @@ -620,8 +620,10 @@ namespace FlaxEngine.GUI { var left = SelectionLeft >= 0 ? SelectionLeft : 0; if (HasSelection) + { _text = _text.Remove(left, selectionLength); - + SetSelection(left); + } _text = _text.Insert(left, str); SetSelection(left + str.Length);