Skip to content

Commit

Permalink
Only update selection if focus comes from TabItem. (#16338)
Browse files Browse the repository at this point in the history
This is a temporary workaround to help Actipro's issues #15433: they're embedding other controls in a `TabControl`-derived control and they don't want these other controls to change the selection when they're focused.
  • Loading branch information
grokys authored Jul 19, 2024
1 parent 8ea60fe commit 34558f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/TabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected override void OnGotFocus(GotFocusEventArgs e)
{
base.OnGotFocus(e);

if (e.NavigationMethod == NavigationMethod.Directional)
if (e.NavigationMethod == NavigationMethod.Directional && e.Source is TabItem)
{
e.Handled = UpdateSelectionFromEventSource(e.Source);
}
Expand Down

0 comments on commit 34558f2

Please sign in to comment.