xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] accessibility issues for screen reader users #14104

Open albertotirla opened 3 years ago

albertotirla commented 3 years ago

Description

When using simple navigation pages to perform hierarchical navigation, screen readers have issues, a lot of them.
First, because, instead of a new android activity or equivalent for other platforms, fragments and frames or pannels are used, screen readers don't even see it as a new window, so they don't read the new content, not unless the user tabs through it. This is, shall I say, not a very acceptable drawback to lightweitness for end users, as they'd kinda have to guess that new content appeared.
next, because this is not a standard way of navigation for the platforms and as the back button is not labeled on any platform, people have difficulty navigating through the app, for example in android there's only a back button, while in uwp, the back button isn't visible at all to screen readers, so they have to quit the app entirely in order to get back.
Now, try comparing this to something like other native apps on the platforms, like the android and iOS settings, even the windows uwp settings app. Even on there, not everything is fully accessible, but better than what we currently have in xamarin.forms.
I know I can always use custom renderers and stuff, but x.f is designed to be as cross-platform as possible, and you say apps made with it integrate with the ecosystem, well, I haven't seen this behaviour in any native android, iOS or uwp app I have ever used.
As a patch till this can be solved, I recommend you make a system for us to be able to configure if we want native screens like activities on android or views on iOS, or keep the default fragment based navigation. For example, in the application constructor, you can have an optional parameter, like UseFragments that's true by default. If true, it will use android activities for new pages. Of course the parameter has to have a platform-agnostic name, but it was a good one to make an example out of.

Steps to Reproduce

  1. In visual studio, go to file>new>project and create a brand new xamarin.forms mobile app from the new project wizard.
  2. Once you can, choose blank app(xamarin.forms) from the drop down list with apps you can make. I choose blank app because it has only one content page, and navigation problems can be more easily observed.
  3. Make the first page support navigation, than make another page, then create a button on the first page to navigate to the second one when clicked.
  4. Try with the main screen readers for the platform, in this case, voiceover, talkback, and finally narrator or nvda.

Expected Behavior

The screen readers should see the pages like they do with other native apps in their ecosystem, they should read the back(navigate up...) button, the window should be considered a child of the current app window, the focus should go to the top of the page like usual, not somewhere random, etc. For inspiration, just try using a screen reader with other apps on the systems, not only things like the built-in apps, but also apps known to be accessible and made by third parties.

Actual Behavior

None of this happen, in stead the screen readers don't read the newly navigated to page as expected, not untill it's interacted with. On windows, one can't get out of a page unles one closes the entire app and on android the back button is unlabeled.

Basic Information

Environment

Microsoft Visual Studio Community 2019 Version 16.8.4 VisualStudio.16.Release/16.8.4+30907.101 Microsoft .NET Framework Version 4.8.04084

Installed Version: Community

Visual C++ 2019 00435-60000-00000-AA711 Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.8.557.25636 ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services 16.1.0.2052803+84e121f1403378489b842e1797df2f3f5a49ac3c Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019 16.8.557.25636 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.8.557.25636 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.8.557.25636 Azure Functions and Web Jobs Tools

C# Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub.VisualStudio 2.11.106.19330 A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Markdown Editor 1.12.253 A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30924.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.8.43 (00471f8) Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.8.1 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62012.31170 Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 16.0.21016.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Foo 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Xamarin 16.8.000.261 (d16-8@bb99248) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.8.0.507 (remotes/origin/d16-8@e87b24884) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.8.112 (86385a3) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.1.0.26 (d16-8/a36ce73) Xamarin.Android Reference Assemblies and MSBuild support. Mono: 5e9cb6d Java.Interop: xamarin/java.interop/d16-8@79d9533 ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000 SQLite: xamarin/sqlite/3.32.1@1a3276b Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

Xamarin.iOS and Xamarin.Mac SDK 14.8.0.3 (c51fabee8) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

Not applicable

Screenshots

Not needed, this is an accessibility issue, and I'm blind my self, so can't provide one

Reproduction Link

https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/getstarted-notes-navigation/

Workaround

The only workaround I found is to delve in the watters of custom renderers, but it would be too much hassle to do that for every platform I am supporting, this way I'd better make a separate app for each one.

albertotirla commented 3 years ago

did anyone manage to fix the bugs mentioned above? If not, which I assume it's the case now with maui and all, does anyone know of any quick and dirty workarounds that don't imply making of custom renderors or anything too complicated?

rachelkang commented 3 years ago

Hi, @albertotirla - thanks for submitting this issue! As you mentioned, we're spending a lot of time on MAUI, but we're also actively working on many of the accessibility issues you've described as well :)

  1. What version of Xamarin.Forms are you using? If you're not yet on XF5, I highly recommend updating to it, as we introduced some accessibility fixes there and are continuing to do so.
  2. We'll soon be introducing more fixes to XF via an accessibility experimental flag https://github.com/xamarin/Xamarin.Forms/pull/14089 and welcome you to make any suggestions for further improvements there that you think would be helpful.
  3. There are new APIs we're actively exploring at this repo https://github.com/PureWeen/A11YTools that you can start taking advantage of to get around any other issues you might be experiencing! This repo is constantly being updated and we welcome suggestions for new APIs to explore here as well.

I hope this helps - let me know how it goes!