Skip to content

Commit

Permalink
Fix #582, check focus manager
Browse files Browse the repository at this point in the history
  • Loading branch information
amwx committed Jun 23, 2024
1 parent 09757c5 commit 5a5c25d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FluentAvalonia/UI/Controls/FAComboBox/FAComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ protected override void OnLostFocus(RoutedEventArgs e)

bool HasImplicitFocus()
{
var c = TopLevel.GetTopLevel(this).FocusManager.GetFocusedElement() as Control;
var c = TopLevel.GetTopLevel(this)?.FocusManager?.GetFocusedElement() as Control;
// FAComboBoxItem is the only container we allow, so if it has focus
// we know we're in this ComboBox's dropdown and have implicit focus
if (c is FAComboBoxItem)
Expand Down

0 comments on commit 5a5c25d

Please sign in to comment.