Skip to content

Commit

Permalink
Fix ContextMenu freeze.
Browse files Browse the repository at this point in the history
  • Loading branch information
Takoooooo committed Apr 25, 2022
1 parent 4f0ad99 commit 5d9dbca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/ItemsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private void UpdatePseudoClasses(int itemCount)
}

c = result;
} while (c != null && c != from);
} while (c != null && c != from && direction != NavigationDirection.First && direction != NavigationDirection.Last);

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected internal virtual void PointerReleased(object? sender, PointerReleasedE

protected internal virtual void MenuOpened(object? sender, RoutedEventArgs e)
{
if (e.Source == Menu)
if (e.Source is Menu)
{
Menu?.MoveSelection(NavigationDirection.First, true);
}
Expand Down

0 comments on commit 5d9dbca

Please sign in to comment.