Skip to content

Commit 34558f2

Browse files
authored
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.
1 parent 8ea60fe commit 34558f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Avalonia.Controls/TabControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ protected override void OnGotFocus(GotFocusEventArgs e)
256256
{
257257
base.OnGotFocus(e);
258258

259-
if (e.NavigationMethod == NavigationMethod.Directional)
259+
if (e.NavigationMethod == NavigationMethod.Directional && e.Source is TabItem)
260260
{
261261
e.Handled = UpdateSelectionFromEventSource(e.Source);
262262
}

0 commit comments

Comments
 (0)