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

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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 @@ -3997,7 +3997,7 @@ private void Refresh(bool fullRefresh, int startRow, int endRow)
startRow = 0;
}

if (fullRefresh || OwnerGrid.HavePropertyEntriesChanged())
if (OwnerGrid.HavePropertyEntriesChanged())
Copy link
Member

Choose a reason for hiding this comment

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

COuld you please help me understand this fix? I would expect that in this scenario OwnerGrid.HavePropertyEntriesChanged is true.

Copy link
Member Author

@LeafShi1 LeafShi1 Nov 7, 2024

Choose a reason for hiding this comment

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

When setting a property, the SetPropertyValue method is called. In this method, the Refresh method is called to refresh the property list based on the Attribute of the property.

But in fact, when setting the AutoSize property, the number and structure of properties in the property list will not change. We only need to refresh the linked property values, so there is no need to recreate the property list.

Copy link
Member Author

Choose a reason for hiding this comment

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

When we switch the value of the edit text by pressing the up and down keys, the SelectAll event will be called, and this event will eventually enter the SelectInternal method. The AI ​​notification is sent from the SelectInternal method here, but the notification sent here is UIA_Text_TextSelectionChangedEventId. If we add notification UIA_AutomationFocusChangedEventId to it, this problem also can be resolved.

image

Copy link
Member

@Tanya-Solyanik Tanya-Solyanik Nov 12, 2024

Choose a reason for hiding this comment

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

But in fact, when setting the AutoSize property, the number and structure of properties in the property list will not change. We only need to refresh the linked property values, so there is no need to recreate the property list.

Please verify this with a Label control and Multiline property ( if still applicable to the new approach)

Copy link
Member

Choose a reason for hiding this comment

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

Please test with NVDA and JAWS.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested with NVDA and JAWS, same results for both tools
And using the changes from commit1 and commit 2, same results too.
VeriftWithNVDA

{
if (HasEntries && !InPropertySet && !CommitEditTextBox())
{
Expand Down