dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.18k stars 1.75k forks source link

ListView Context Actions with non-intuitive accessibility on Android #7028

Open dawidpieper opened 2 years ago

dawidpieper commented 2 years ago

Description

The typical behavior on Android is, when opening a context menu, to present a popup window with available actions. In Maui, menu actions are displayed in the navigation bar, though. This being visible for a sighted user, may confuse when using screenreaders. We get a notification in form of a phone vibration, but many users are not likely to guess where to look for the opened menu.

The best option, in my opinion, would be to implement the following behavior:

  1. When context menu appears, the accessibility focus should be placed on the first menu item,
  2. When menu is closed, the accessibility focus should return to the list item that the menu corresponded to.

If this issue gets accepted, I will be happy to try to make PR fixing it.

Steps to Reproduce

  1. Create a Maui project.
  2. Create a ListView with ContextActions.
  3. When a long tap is performed, menu displays in a navigation bar.

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

The workaround would be to define own Context Menu behavior. Unfortunately Maui does not provide a long press GestureRecognizer, so it is a bit tricky and requires a lot of Android native code.

Relevant log output

No response

jfversluis commented 2 years ago

Hey @dawidpieper this definitely sounds to me like something we would like to look into, especially if it's not great in terms of accessibility. If you could offer help implementing it that would be amazing!

cc: @rachelkang any thoughts?