Skip to content

Commit

Permalink
Merge pull request unoplatform#15305 from ramezgerges/textbox_delete_…
Browse files Browse the repository at this point in the history
…caret_moves

fix skia textbox's caret moving to the start of text on Delete
  • Loading branch information
ramezgerges authored Feb 13, 2024
2 parents 99a4fb2 + 763a898 commit b7d419f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,13 @@ protected virtual void OnTextChanged(string oldValue, string newValue)
{
UpdateInlines(newValue);

Selection = new Range(0, 0);
#if __SKIA__
if (TemplatedParent is not TextBox textBox || textBox.TextBoxView?.DisplayBlock != this)
#endif
{
// On skia, we don't want to set the selection here in case TextBox is managing the selection.
Selection = new Range(0, 0);
}

OnTextChangedPartial();
InvalidateTextBlock();
Expand Down

0 comments on commit b7d419f

Please sign in to comment.