Skip to content

Commit d8516fe

Browse files
authored
Merge pull request #1114 from orrindeng/pr230313
Fix combobox can't open dropdown when the editable textbox of it has the focus
2 parents 9a66e30 + 920b049 commit d8516fe

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Fluent.Ribbon/Controls/ComboBox.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,11 @@ protected override void OnDropDownOpened(EventArgs e)
658658

659659
if (this.SelectedItem is not null)
660660
{
661-
Keyboard.Focus(this.ItemContainerGenerator.ContainerOrContainerContentFromItem<IInputElement>(this.SelectedItem));
661+
var selectedItemContainer = this.ItemContainerGenerator.ContainerOrContainerContentFromItem<IInputElement>(this.SelectedItem);
662+
if (selectedItemContainer is not null)
663+
{
664+
Keyboard.Focus(selectedItemContainer);
665+
}
662666
}
663667

664668
this.focusedElement = Keyboard.FocusedElement;

0 commit comments

Comments
 (0)