Browse Source

Added KeyboardNavigationMode.Local.

pull/5996/head
Steven Kirk 5 years ago
parent
commit
f1c87b4043
  1. 7
      src/Avalonia.Input/KeyboardNavigationMode.cs
  2. 3
      src/Avalonia.Input/Navigation/TabNavigation.cs

7
src/Avalonia.Input/KeyboardNavigationMode.cs

@ -36,5 +36,10 @@ namespace Avalonia.Input
/// The container's children will not be focused when using the tab key.
/// </summary>
None,
/// <summary>
/// TabIndexes are considered on local subtree only inside this container
/// </summary>
Local,
}
}
}

3
src/Avalonia.Input/Navigation/TabNavigation.cs

@ -152,6 +152,9 @@ namespace Avalonia.Input.Navigation
// Look for element with the same TabIndex before the current element
while ((nextTabElement = GetPrevTabInGroup(nextTabElement, container, tabbingType)) != null)
{
if (nextTabElement == container && tabbingType == KeyboardNavigationMode.Local)
break;
// At this point nextTabElement is TabStop or TabGroup
// In case it is a TabStop only return the element
if (IsTabStop(nextTabElement) && !IsGroup(nextTabElement))

Loading…
Cancel
Save