Browse Source

When clearing focus don't reselect the existing focus scope.

Fixes #4906.
pull/5492/head
Steven Kirk 6 years ago
parent
commit
06307865dc
  1. 4
      src/Avalonia.Input/FocusManager.cs

4
src/Avalonia.Input/FocusManager.cs

@ -75,7 +75,9 @@ namespace Avalonia.Input
// If control is null, set focus to the topmost focus scope. // If control is null, set focus to the topmost focus scope.
foreach (var scope in GetFocusScopeAncestors(Current).Reverse().ToList()) foreach (var scope in GetFocusScopeAncestors(Current).Reverse().ToList())
{ {
if (_focusScopes.TryGetValue(scope, out var element) && element != null) if (scope != Scope &&
_focusScopes.TryGetValue(scope, out var element) &&
element != null)
{ {
Focus(element, method); Focus(element, method);
return; return;

Loading…
Cancel
Save