Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Epica3055
Copy link
Member

@Epica3055 Epica3055 commented Feb 21, 2025

Fixes #12941

Proposed changes

  • when OnKeyDown is triggered, Hide dropdown properly.

Regression?

  • No

Screenshots

Before

WinFormsApp-TestCombobox_eC5825XdQA.mp4

After

Issue_12941.mp4

Test methodology

  • Manual
Microsoft Reviewers: Open in CodeFlow

@Epica3055 Epica3055 requested a review from a team as a code owner February 21, 2025 05:54
@Epica3055 Epica3055 requested a review from Copilot February 21, 2025 05:55

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

// 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;
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.01253%. Comparing base (ff19802) to head (6752039).
Report is 79 commits behind head on main.

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     
Flag Coverage Δ
Debug 76.01253% <33.33333%> (-0.12659%) ⬇️
integration 18.02927% <0.00000%> (-0.14390%) ⬇️
production 49.96040% <33.33333%> (-0.12258%) ⬇️
test 96.93683% <ø> (-0.03306%) ⬇️
unit 47.41202% <33.33333%> (-0.01555%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@LeafShi1 LeafShi1 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@ricardobossan ricardobossan left a 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;
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combox autocomplete list weird selection behaviour
5 participants