From e7151b24e67f9ba2e16433c0915554d7f483a4f0 Mon Sep 17 00:00:00 2001 From: Deng Aolin Date: Mon, 13 Mar 2023 16:51:23 +0800 Subject: [PATCH 1/2] Fix combobox can't open dropdown when the editable textbox of it has the focus --- Fluent.Ribbon/Controls/ComboBox.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Fluent.Ribbon/Controls/ComboBox.cs b/Fluent.Ribbon/Controls/ComboBox.cs index 62e990b6..290a8fe8 100644 --- a/Fluent.Ribbon/Controls/ComboBox.cs +++ b/Fluent.Ribbon/Controls/ComboBox.cs @@ -658,7 +658,11 @@ protected override void OnDropDownOpened(EventArgs e) if (this.SelectedItem is not null) { - Keyboard.Focus(this.ItemContainerGenerator.ContainerOrContainerContentFromItem(this.SelectedItem)); + var selectedItemContainser = this.ItemContainerGenerator.ContainerOrContainerContentFromItem(this.SelectedItem); + if (selectedItemContainser is not null) + { + Keyboard.Focus(selectedItemContainser); + } } this.focusedElement = Keyboard.FocusedElement; From 920b0494fe4bea3474ff2392e031fe05a24ebe8a Mon Sep 17 00:00:00 2001 From: Deng Aolin Date: Mon, 13 Mar 2023 17:50:08 +0800 Subject: [PATCH 2/2] Correct word spelling --- Fluent.Ribbon/Controls/ComboBox.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Fluent.Ribbon/Controls/ComboBox.cs b/Fluent.Ribbon/Controls/ComboBox.cs index 290a8fe8..df32d1f4 100644 --- a/Fluent.Ribbon/Controls/ComboBox.cs +++ b/Fluent.Ribbon/Controls/ComboBox.cs @@ -658,10 +658,10 @@ protected override void OnDropDownOpened(EventArgs e) if (this.SelectedItem is not null) { - var selectedItemContainser = this.ItemContainerGenerator.ContainerOrContainerContentFromItem(this.SelectedItem); - if (selectedItemContainser is not null) + var selectedItemContainer = this.ItemContainerGenerator.ContainerOrContainerContentFromItem(this.SelectedItem); + if (selectedItemContainer is not null) { - Keyboard.Focus(selectedItemContainser); + Keyboard.Focus(selectedItemContainer); } }