SfComboBox Dropdown Positioning and Keyboard Focus Issues in .NET MAUI
First Issue - Inconsistent Dropdown Positioning: When you initially tap to open the dropdown without typing anything, it opens above the input field (as shown in your screenshot), which covers the search field and makes it difficult to see what you're typing. However, once you start typing and filtering begins, the dropdown repositions itself below the field. This inconsistent behavior is caused by SfComboBox's internal logic that handles positioning differently when filtering is active versus when it first opens.
Second Issue - Unwanted Keyboard Activation: After selecting an item from the dropdown, the soft keyboard automatically appears even though you don't need it anymore since the selection is complete. This happens because the SfComboBox's internal Entry component regains focus after selection, triggering the keyboard to show. This is particularly annoying on mobile devices where the keyboard takes up significant screen space and provides no value after the selection is made.
Both of these issues stem from SfComboBox's default behavior and internal focus management, and they significantly impact the user experience by making the dropdown feel clunky and unpredictable. The positioning issue makes it hard to see what you're searching for initially, while the keyboard issue creates unnecessary UI clutter after selection.
Attachment: da5dc2bc61cb483da0624350fccb7d49_491d2fcc.jpg
Hi Haris,
Thank you for contacting us.
For the dropdown positioning behavior you described, please try setting the `MaxDropDownHeight` property of the SfComboBox to a suitable value. This lets you control the maximum height of the dropdown and can help ensure it displays as expected.
Example:
|
<editors:SfComboBox x:Name="comboBox" MaxDropDownHeight="150" ItemsSource="{Binding SocialMedias}" DisplayMemberPath="Name" TextMemberPath="Name" />
|
For additional guidance, please see our UG documentation - Maximum-dropdown-height
Regarding the keyboard appearing after selection, we are currently validating this scenario. We’ll share an update with you on or before September 16, 2025. We appreciate your patience until then.
Regards,
Vidyalakshmi M.
Hi Haris,
Regarding query “After selecting an item from the dropdown, the soft keyboard automatically appears”
We have checked the reported scenario and have taken this as an improvement and logged a feature request for it. We plan to implement it in any of our upcoming releases, and we will notify you as soon as it becomes available.
You can track its progress using the following feedback link: Prevent Keyboard from Reappearing After Item Selection in .NET MAUI SfComboBox in .NET MAUI | Feedback Portal
In the meantime, please feel free to contact us through our Feature Report page for any other features or issues. We appreciate your patience and understanding.
However, to meet your requirement of closing the keyboard after selecting an item from the dropdown in SfComboBox, we suggest a workaround. We have created a CustomComboBox control that implements the required behavior using the `SelectionChanged` and `DropDownClosed` events. Please refer to the attached sample and below code snippets for more details.
|
public class CustomComboBox : SfComboBox { Entry entryChildren; object sameSelectedItem; int sameItemSelectionCount = 0; public CustomComboBox() { entryChildren = this.Children[1] as Entry;
this.SelectionChanged += CustomComboBox_SelectionChanged; this.DropDownClosed += CustomComboBox_DropDownClosed;
}
private async void CustomComboBox_DropDownClosed(object sender, EventArgs e) { if (this.SelectedItem == sameSelectedItem) { this.sameItemSelectionCount++; if(this.sameItemSelectionCount > 1) { await Task.Delay(300);
KeyboardExtensions.HideKeyboardAsync((ITextInput)entryChildren, default); this.Unfocus(); } } }
private async void CustomComboBox_SelectionChanged(object sender, Syncfusion.Maui.Inputs.SelectionChangedEventArgs e) { if (KeyboardExtensions.IsSoftKeyboardShowing((ITextInput)entryChildren) && this.SelectedItem != null) { sameSelectedItem = this.SelectedItem; await Task.Delay(300);
KeyboardExtensions.HideKeyboardAsync((ITextInput)entryChildren, default); this.Unfocus(); } else { await KeyboardExtensions.ShowKeyboardAsync((ITextInput)entryChildren, default); }
} } |
If you have any further questions or need any help, please let us know, we’re here to help!
Regards,
Vidyalakshmi M.
Attachment: AutocompleteSample_1df4496.zip
- 2 Replies
- 2 Participants
-
HI Haris Imran
- Sep 11, 2025 07:53 PM UTC
- Sep 16, 2025 02:51 PM UTC