Fix textbox selection when deleting

See https://forum.flaxengine.com/t/renaming-items-in-the-content-area-problem/334
This commit is contained in:
stefnotch
2021-04-24 10:30:08 +02:00
parent 37ed8afb30
commit 3c2c95d670

View File

@@ -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);