Skip to content

Commit

Permalink
Merge pull request #1114 from orrindeng/pr230313
Browse files Browse the repository at this point in the history
Fix combobox can't open dropdown when the editable textbox of it has the focus
  • Loading branch information
batzen committed Mar 13, 2023
2 parents 9a66e30 + 920b049 commit d8516fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Fluent.Ribbon/Controls/ComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ protected override void OnDropDownOpened(EventArgs e)

if (this.SelectedItem is not null)
{
Keyboard.Focus(this.ItemContainerGenerator.ContainerOrContainerContentFromItem<IInputElement>(this.SelectedItem));
var selectedItemContainer = this.ItemContainerGenerator.ContainerOrContainerContentFromItem<IInputElement>(this.SelectedItem);
if (selectedItemContainer is not null)
{
Keyboard.Focus(selectedItemContainer);
}
}

this.focusedElement = Keyboard.FocusedElement;
Expand Down

0 comments on commit d8516fe

Please sign in to comment.