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

Unhook the mouse down hook at the end of PropertyGridView.ProcessEnumUpAndDown #12508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Nov 19, 2024

Fixes #12434

Root cause:

After changing the value by pressing up/down keyboard directly in EditTextbox, the EditTextBox.HookMouseDown will be set to True

The stack trace:

at System.Windows.Forms.PropertyGridInternal.PropertyGridView.GridViewTextBox.set_HookMouseDown(Boolean value)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.SetCommitError(ErrorState error, Boolean capture)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.OnEditChange(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
at System.Windows.Forms.Control.set_Text(String value)
at System.Windows.Forms.TextBoxBase.set_Text(String value)
at System.Windows.Forms.TextBox.set_Text(String value)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.GridViewTextBox.set_Text(String value)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.CommitValue(GridEntry entry, Object value, Boolean closeDropDown)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.ProcessEnumUpAndDown(GridEntry entry, Keys keyCode, Boolean closeDropDown)


then pressing Alt+Down to open the DropDown list, and select a item, the CommitValue will be invoked.
At this time, EditTextBox.HookMouseDown = true. In HookMouseDown, the Focus() was invoked, so the DropDown list was collapsed.

Proposed changes

  • Set EditTextBox.HookMouseDown = false at the end of PropertyGridView.ProcessEnumUpAndDown

Customer Impact

  • When pressing the up/down keyboard in the property drop-down list, the drop-down menu will not be collapsed directly

Regression?

  • No

Risk

  • Mininal

Screenshots

Before

Pressing Up/Down keyboard in drop-down list of property collapses dropdown directly.
Image

After

When pressing the up/down keyboard in the property drop-down list, the drop-down menu will not be collapsed directly
AfterChange

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-beta.24562.15
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner November 19, 2024 10:35
@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.74025%. Comparing base (af49f16) to head (c455950).
Report is 42 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12508         +/-   ##
===================================================
+ Coverage   75.73242%   75.74025%   +0.00782%     
===================================================
  Files           3153        3157          +4     
  Lines         635807      636099        +292     
  Branches       46975       47003         +28     
===================================================
+ Hits          481512      481783        +271     
+ Misses        150870      150851         -19     
- Partials        3425        3465         +40     
Flag Coverage Δ
Debug 75.74025% <0.00000%> (+0.00782%) ⬆️
integration 18.17880% <0.00000%> (-0.07574%) ⬇️
production 49.30640% <0.00000%> (+0.00087%) ⬆️
test 97.04530% <ø> (-0.00464%) ⬇️
unit 46.49746% <0.00000%> (+0.23438%) ⬆️

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

@ricardobossan
Copy link
Member

I proceeded to test the changes made in this PR and the problem seems to be solved:

12508

@Tanya-Solyanik Tanya-Solyanik added the 📬 waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) waiting-review This item is waiting on review by one or more members of team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Accessibility] Pressing Up/Down keyboard in drop-down list of property collapses drop-down directly
3 participants