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
21.65k stars 1.63k forks source link

[Bug][iOS] SemanticScreenReader.Announce not working on iOS #3736

Open rachelkang opened 2 years ago

rachelkang commented 2 years ago

Description

SemanticScreenReader.Announce appears not to be working on iOS. It should read out the test specified, but it reads out nothing

Steps to Reproduce

  1. Run recipes app on iOS
  2. Turn on VoiceOver
  3. Click on "Breakfast" button
  4. Click on any recipe
  5. Click on "Add to My Recipes" button
  6. Notice that the message ("This recipe has been added to your personal recipe collection! Go to the 'My Recipes' tab to view and modify this recipe from there") does not get read aloud

Version with bug

Preview 11

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

Add a delay before making the call i.e. https://github.com/dotnet/maui/blob/recipes/src/Essentials/src/SemanticScreenReader/SemanticScreenReader.ios.cs#L17

Before using SemnticScreenReader.Announce(), include a Task.Delay(x) where x may vary based on your system's processing speed. Since VoiceOver is already making announcements based on interactions, this is necessary to work around the timing issue of forcing an additional announcement

Relevant log output

No response

rachelkang commented 2 years ago

Shane found a workaround/solution for this! Involves adding a delay. It's fixed on the recipes branch; will close this when it's in main

hartez commented 2 years ago

Shane found a workaround/solution for this! Involves adding a delay. It's fixed on the recipes branch; will close this when it's in main

What do you mean by "adding a delay"?

rachelkang commented 2 years ago

https://github.com/dotnet/maui/blob/recipes/src/Essentials/src/SemanticScreenReader/SemanticScreenReader.ios.cs#L17

related to https://stackoverflow.com/questions/26847179/uiaccessibilityannouncementnotification-voiceover-interruption

Zhanglirong-Winnie commented 2 months ago

Verified this issue with Visual Studio 17.6.9 (build 415). Can repro on iOS platform with sample project. VoiceOver does not speak any buttons on the iOS simulator, My Mac works fine. image