Browse Source

Only update selection if focus comes from TabItem. (#16338)

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.
pull/16373/head
Steven Kirk 2 years ago
committed by GitHub
parent
commit
34558f25e0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Avalonia.Controls/TabControl.cs

2
src/Avalonia.Controls/TabControl.cs

@ -256,7 +256,7 @@ namespace Avalonia.Controls
{
base.OnGotFocus(e);
if (e.NavigationMethod == NavigationMethod.Directional)
if (e.NavigationMethod == NavigationMethod.Directional && e.Source is TabItem)
{
e.Handled = UpdateSelectionFromEventSource(e.Source);
}

Loading…
Cancel
Save