-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combox autocomplete list weird selection behaviour #12941
Comments
Thank you for documenting this issue. It certainly is an inconvenience for the end user. Given that it behaves the same in .NET Framework, we are inclined to close the issue, as it doesn't make the current bar. @jbennink, if this is something that you really want to have addressed, we would be more than interested in taking a PR from you. But at this point I will close the issue. |
I can provide you an workaround you can try and see if it fixes your problem comboBox1.TextChanged += ComboBox1_TextChanged;
}
private void ComboBox1_TextChanged(object? sender, EventArgs e)
{
if (comboBox1.Text.Length > 0)
{
// close dropdown
foreach (var item in comboBox1.Items)
{
if (item?.ToString()?.StartsWith(comboBox1.Text, StringComparison.CurrentCultureIgnoreCase) == true)
{
comboBox1.DroppedDown= false;
}
}
}
} |
.NET version
Tested with NET9.0.200.
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
The issue is that when you first open de dropdownlist, and then start typing to autocomplete it creates a seperate short list that matches you autocomplete (looks werid those two lists on top of each other). But then when you try to select an item with the mouse in the autocomplete list, it actually selects an item from the opend dropdownlist. Tryin to navigate the autocomplete list with the keyboard and selecting by pressing enter does nothing, no selection from either list.
Expected behaviour
I would have expected the autocomplete (filtering) to occur in the actual Dropdown list to prevent these double lists from displaying.
OR
When starting to type, close the dropdownlist, and show the autocomplete list. This might prevent the selection issue that occurs
Steps to reproduce
Run the samples from this github: https://github.com/jbennink/WinFormsApp-TestCombobox
Demo movie in repo:
WinFormsApp-TestCombobox_eC5825XdQA.mp4
The text was updated successfully, but these errors were encountered: