Skip to content

Fixed the issue where edit textBox loses focus when using up/down to switch property values ​​on edit textBox #12431

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

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Nov 6, 2024

Fixes #12440

Proposed changes

  • When setting a property with the [RefreshProperties(RefreshProperties.All)] attribute, suppress recalculation and reset constants for the entire property page

Customer Impact

  • The rectangle in the edit text box always stays in the edit textbox when changing the property value using the up/down buttons

Regression?

  • No

Risk

  • Mininal

Screenshots

Before

The rectangle always back to focus on entire row after using the up/down changed the property values directly in the edit textbox
BeforeChanges

After

The rectangle in the edit text box always stays in the edit textbox when changing the property value using the up/down buttons
AfterChanges

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-alpha.1.24554.9
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner November 6, 2024 07:18
@LeafShi1 LeafShi1 changed the title Fix editor text box focus issue when switching value property grid view Fixed the issue where EditorTextBox loses focus when using up/down to switch property values ​​on EditorTextBox Nov 6, 2024
@LeafShi1 LeafShi1 changed the title Fixed the issue where EditorTextBox loses focus when using up/down to switch property values ​​on EditorTextBox Fixed the issue where edit textBox loses focus when using up/down to switch property values ​​on EditorTextBox Nov 6, 2024
@LeafShi1 LeafShi1 changed the title Fixed the issue where edit textBox loses focus when using up/down to switch property values ​​on EditorTextBox Fixed the issue where edit textBox loses focus when using up/down to switch property values ​​on edit textBox Nov 6, 2024
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

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

Project coverage is 75.73581%. Comparing base (65f897b) to head (7b9e0f2).
Report is 47 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12431         +/-   ##
===================================================
+ Coverage   75.65407%   75.73581%   +0.08173%     
===================================================
  Files           3150        3153          +3     
  Lines         635831      635797         -34     
  Branches       47020       46973         -47     
===================================================
+ Hits          481032      481526        +494     
+ Misses        151352      150839        -513     
+ Partials        3447        3432         -15     
Flag Coverage Δ
Debug 75.73581% <0.00000%> (+0.08173%) ⬆️
integration 18.27145% <0.00000%> (+0.02238%) ⬆️
production 49.31168% <0.00000%> (+0.11336%) ⬆️
test 97.05103% <ø> (+0.02079%) ⬆️
unit 46.28890% <0.00000%> (+0.13293%) ⬆️

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

---- 🚨 Try these New Features:

@LeafShi1
Copy link
Member Author

LeafShi1 commented Nov 6, 2024

The private dlls have been tested, no regression issue was found.

@Tanya-Solyanik
Copy link
Contributor

Tanya-Solyanik commented Nov 7, 2024

@LeafShi1 - please fix a link to the issue, right now it points to another PR

Actually, this is a non-regression problem found when testing PR #12356. No issue was filed before.
I created an issue for it and the issue link has been updated.

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.

Tested the changes and the TextBox does not lose focus when you press up/down.

Changes LGTM.

@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 12, 2024
Tanya-Solyanik
Tanya-Solyanik previously approved these changes Nov 13, 2024
@Olina-Zhang
Copy link
Member

Tested this PR change with several regression issues found. Need to investigate.

@Olina-Zhang Olina-Zhang removed 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 13, 2024
@LeafShi1 LeafShi1 force-pushed the Fix_EditorTextBox_focusIssue_when_switch_value_in_PropertyGridView branch from 9bf352b to 7b9e0f2 Compare November 14, 2024 06:15
@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Nov 14, 2024
@LeafShi1
Copy link
Member Author

LeafShi1 commented Nov 15, 2024

@Tanya-Solyanik The second commit caused 3 unstabled regression issues, RaiseAutomationEvent(UIA_EVENT_ID.UIA_AutomationFocusChangedEventId) does not stably focus the accessibility rectangle on the edit text box, so consider the solution When setting a property with the [RefreshProperties(RefreshProperties.All)] attribute, only the relevant property values ​​are refreshed instead of recalculating and refreshing the entire property list in commit1. And commit1 has been tested before, no regression issue.

Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

ok, let's remove the fullRefresh test.

@Tanya-Solyanik Tanya-Solyanik added ready-to-merge PRs that are ready to merge but worth notifying the internal team. and removed waiting-review This item is waiting on review by one or more members of team labels Nov 20, 2024
@LeafShi1 LeafShi1 merged commit dc4314e into dotnet:main Nov 20, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview1 milestone Nov 20, 2024
@dotnet-policy-service dotnet-policy-service bot removed the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Nov 20, 2024
@LeafShi1 LeafShi1 deleted the Fix_EditorTextBox_focusIssue_when_switch_value_in_PropertyGridView branch December 9, 2024 09:38
LeafShi1 added a commit to LeafShi1/winforms that referenced this pull request Dec 9, 2024
…switch property values ​​on edit textBox (dotnet#12431)

* Fix editor text box focus issue when switching value property grid view

* Override function SelectInternal in file PropertyGridView.GridViewTextBox.cs

* Removing fullRefresh condition from function Refresh
Tanya-Solyanik pushed a commit that referenced this pull request Jan 9, 2025
…r experience in dropdown type editors in property grid (#12605)

Backport of #12508, #12431, #12356 and #12479 to release/9.0
Fixes #12607
NET10 Bugs: #12434, #12421, #12440, #12031

Bug Description
There are four issues that occur when using the up/down keys to switch property values ​​in the property page.

When navigating to "Auto Size" dropdown using the up/down arrow keys, it is getting auto selected without hitting ENTER

After using Tab to switch property values, then using the up/down keys to switch items in the drop-down box expanded by F4 will cause the drop-down box to collapse directly

[Accessibility] When using up/down to toggle property value on edit text box, The Accessibility ​​rectangle focuses on the entire property row instead of the original edit text box

[Accessibility] Narrator cannot announce items correctly when switching the items by using up/down keyboard arrow that without expand the dropdown list panel

Customer Impact
PropertyGrid drop down type editor does not support conventional keyboard navigation. Usually, selection is committed when the ENTER key is pressed. However, in this case value is committed on the Down arrow press. Then the drop down list is expanded, the screen reader user might want to navigate through all values in the drop down using the arrows, on each arrow key press the new item should be presented (and announced) in the selection text box, however, the drop down is closed on the first arrow key. According to the accessibility SMEs, this is a major problem - the keyboard users are losing their work by committing a wrong value. Screen reader user don't get correct feedback when navigating through the drop down list.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using up/down to toggle property value on edit text box, edit text box loses focus
4 participants