Skip to content

[iOS][a11y] VoiceOver on UIKitView seems to be broken  #135504

@romgrm

Description

@romgrm

Is there an existing issue for this?

Steps to reproduce

Hello !
I've already opened a question on this topic #131780 and by searching more on my side, I may have found the problem.

I need the native iOS Apple Pay button for my application. So I'm using the pay_ios library and I realised that the accessibility focus is stuck on this button.

So I quickly recreated the plugin with a FlutterPlatformView and I have the same problem (so I don't think it's due to the package used).

Then I tried changing the semantics directly in the native part, but the problem is still there.

Finally, I put an ExludeSemantics around the UIKitView, which I then wrapped with a Semantics widget and that's when the problem was solved.

I really think there's a problem in the UiKitView widget about semantics.

In my logs, a debug message appears when the focus is on the UiKitView and it is blocked:

[Accessibility] Went all the way up the container chain from @, but could not find any container that was one of the ordered children of @. This may be acceptable if it happened right around a layout change, but it would be best to double check by swiping left/right to see if you can get to all elements.

It's as if the UiKitView widget wasn't visible in the semantics tree and so VoiceOver was mixing up the widgets and crashing.

I hope I've made myself clear, but please don't hesitate if you need any further explanation.

Expected results

When you slide the cursor to the left, your attention is drawn to the next widget.

Actual results

When swiping left, when the focus goes on UiKitView, it remains blocked and the error appears in the log.

Code sample

return Scaffold(
      body: Center(
          child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          const Text("first example"),
          const Text("second example"),
          const Text("third example"),
          Container(
            color: Colors.red,
            child: RawApplePayButton(
              style: ApplePayButtonStyle.black,
              type: ApplePayButtonType.plain,
            ),
          ),
          const Text("last example"),
        ],
      )),
    );

Screenshots or Video

268323050-5c927cf6-6cd6-4a71-9d5c-fef7da11bde3.mp4

Logs

[Accessibility] Went all the way up the container chain from @, but could not find any container that was one of the ordered children of @. This may be acceptable if it happened right around a layout change, but it would be best to double check by swiping left/right to see if you can get to all elements.

Flutter Doctor output

• Flutter version 3.13.4 on channel stable at /Users/romain_greaume/fvm/versions/3.13.4
! Warning: dart on your path resolves to /opt/homebrew/Cellar/dart/3.0.7/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/romain_greaume/fvm/versions/3.13.4.
Consider adding /Users/romain_greaume/fvm/versions/3.13.4/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 367f9ea (13 days ago), 2023-09-12 23:27:53 -0500
• Engine revision 9064459a8b
• Dart version 3.1.2
• DevTools version 2.25.0
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/romain_greaume/Library/Android/sdk
• Platform android-33, build-tools 33.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 75.1.3
• Dart plugin version 231.9161.14

[✓] VS Code (version 1.82.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.72.0

[✓] Connected device (3 available)
• iPhone 14 (mobile) • 968A4248-A23D-468B-9605-32E3C6ABD134 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.5 22G74 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.187

[✓] Network resources
• All expected network resources are available.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: platform-viewsEmbedding Android/iOS views in Flutter appsc: regressionIt was better in the past than it is nowfound in release: 3.13Found to occur in 3.13found in release: 3.15Found to occur in 3.15has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamwaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions