Skip to content

Commit

Permalink
fix(textbox): don't change TextBlock selection when inside TextBox
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed Feb 1, 2024
1 parent e3b635d commit 763a898
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 763a898

Please sign in to comment.