Skip to content

fix issues#12941 Combox autocomplete list weird selection behaviour #12999

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,16 @@ protected virtual void OnDropDown(EventArgs e)
[EditorBrowsable(EditorBrowsableState.Advanced)]
protected override void OnKeyDown(KeyEventArgs e)
{
// For fix https://github.com/dotnet/winforms/issues/12941
char input = (char)e.KeyValue;
if ((AutoCompleteMode == AutoCompleteMode.Suggest || AutoCompleteMode == AutoCompleteMode.SuggestAppend) &&
!char.IsControl(input))
{
DroppedDown = false;
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in behavior might not work for some users. For example, if the autocomplete list is not displayed because what the user types is not in the drop-down list, we shouldn't close the drop down. I would rather not fix it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to have to agree here. I don't like that change in behavior.

Copy link
Member Author

@Epica3055 Epica3055 Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I will close this PR, maybe someday I will pick it up 🤣

}

// End fix

// Do Return/ESC handling
if (SystemAutoCompleteEnabled)
{
Expand Down