Skip to content

Conversation

@rchauhan18
Copy link
Contributor

@rchauhan18 rchauhan18 commented Jun 6, 2024

Fixes #9216

Description

The issue is that the function is returning the header item value in case of subitem too.
This is because we are not storing the iSubItem value in our local HitTest (which stores information about the hit item)

Fix is to store SubItem details in HitTest (NativeMethods.LVHITTESTINFO_INTERNAL).
On function "ElementProviderFromPoint" call, if there is a SubItem then condition passes, and we return new ListViewSubItem.

if( hitTest.iSubItem >=0 )
{
	return new ListViewSubItem( hwd, paarent, hitTest.iSubItem, item);

}

Customer Impact

Customer who are using wrong value for subitem in UI Automation will need to update.
This fix is not affecting the UI Automation tree of the ListView.

Regression

N/A

Testing

Sample application is working as expected.
Further testing needs to be done.

Risk

Low

Microsoft Reviewers: Open in CodeFlow

@rchauhan18 rchauhan18 requested a review from a team as a code owner June 6, 2024 11:24
@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label Jun 6, 2024
@hiteshkrmsft hiteshkrmsft self-requested a review June 19, 2024 04:04
@dipeshmsft dipeshmsft self-assigned this Aug 5, 2024
@harshit7962 harshit7962 merged commit 816c24a into main Sep 18, 2024
@harshit7962 harshit7962 deleted the FixUIAutomationListView branch September 18, 2024 11:57
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Automation does not return ListView's sub items

6 participants