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

AutomationID in ToolBarItem still maps to content-desc #27030

Open
SigiNeumann opened this issue Jan 9, 2025 · 3 comments
Open

AutomationID in ToolBarItem still maps to content-desc #27030

SigiNeumann opened this issue Jan 9, 2025 · 3 comments
Labels
area-navigation NavigationPage platform/android 🤖 s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity t/a11y Relates to accessibility t/bug Something isn't working

Comments

@SigiNeumann
Copy link

Description

AutomationID in ToolBarItem maps to content-desc instead of resource-id on Android.
Preface as discussed in related issue #4714 the automation will no longer be mapped to content-desc but to resource-id.
This is true for most elements, but not for ToolbarItems, where the AutomationID still maps to content-desc
e.g.
this XAML,
<ContentPage.ToolbarItems> <ToolbarItem Text="Filter" Command="{Binding ToggleFilter}" AutomationId="Btn_ToggleFilter" /> <ToolbarItem Text="Search" Command="{Binding ToggleSearch}" AutomationId="Btn_ToggleSearch" /> </ContentPage.ToolbarItems>
results in the following Android Layout, with the AutomationID in content-desc.

<androidx.appcompat.widget.LinearLayoutCompat index="2" package="com.adresys.angel.angelapp" class="androidx.appcompat.widget.LinearLayoutCompat" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[613,107][1080,275]" displayed="true"> <android.widget.Button index="0" package="com.adresys.angel.angelapp" class="android.widget.Button" text="" content-desc="Btn_ToggleFilter" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[613,119][757,263]" displayed="true" /> <android.widget.Button index="1" package="com.adresys.angel.angelapp" class="android.widget.Button" text="Search" content-desc="Btn_ToggleSearch" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[757,119][936,263]" displayed="true" /> </androidx.appcompat.widget.LinearLayoutCompat>
My wish would be for it to be consistent. We spent quite some time to transition all tools, tests and

Steps to Reproduce

Create a page in your Maui App.
Add ToolbarItems to your page.
Add AutomationId to ToolbarItem.
Deploy to Android.
Check with UiAutomator (e.g. via Appium)

Link to public reproduction project repository

No response

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

@SigiNeumann SigiNeumann added the t/bug Something isn't working label Jan 9, 2025
@jfversluis
Copy link
Member

Can you confirm this is also still the case for .NET 9 with the latest available version on NuGet?

@jfversluis jfversluis added platform/android 🤖 t/a11y Relates to accessibility s/needs-info Issue needs more info from the author labels Jan 13, 2025
Copy link
Contributor

Hi @SigiNeumann. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@samhouts samhouts added the area-navigation NavigationPage label Jan 17, 2025
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Jan 22, 2025
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-navigation NavigationPage platform/android 🤖 s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity t/a11y Relates to accessibility t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants