-
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
fix issues#12941 Combox autocomplete list weird selection behaviour #12999
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs:2438
- [nitpick] The comment 'for fix' should be more descriptive, such as 'Fix for issue Combox autocomplete list weird selection behaviour #12941: Hide dropdown when a non-control key is pressed in AutoComplete mode'.
// for fix https://github.com/dotnet/winforms/issues/12941
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs:2439
- Ensure that the new behavior of hiding the dropdown when a non-control key is pressed in AutoComplete mode is covered by tests.
char input = (char)e.KeyValue;
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12999 +/- ##
===================================================
- Coverage 76.13911% 76.01253% -0.12659%
===================================================
Files 3258 3267 +9
Lines 642851 643465 +614
Branches 47307 47433 +126
===================================================
- Hits 489461 489114 -347
- Misses 149825 150790 +965
+ Partials 3565 3561 -4
Flags with carried forward coverage won't be shown. Click here to find out more. |
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ComboBox/ComboBox.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM!
if ((AutoCompleteMode == AutoCompleteMode.Suggest || AutoCompleteMode == AutoCompleteMode.SuggestAppend) && | ||
!char.IsControl(input)) | ||
{ | ||
DroppedDown = false; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fixes #12941
Proposed changes
Regression?
Screenshots
Before
WinFormsApp-TestCombobox_eC5825XdQA.mp4
After
Issue_12941.mp4
Test methodology
Microsoft Reviewers: Open in CodeFlow