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

[a11y][VoiceOver/Talkback] Dismissable ModalBarrier is not announced as a button #158164

Open
Jerem42 opened this issue Nov 5, 2024 · 5 comments
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) found in release: 3.24 Found to occur in 3.24 found in release: 3.27 Found to occur in 3.27 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project team-accessibility Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter) triaged-accessibility Triaged by Framework Accessibility team

Comments

@Jerem42
Copy link

Jerem42 commented Nov 5, 2024

Steps to reproduce

  1. Have an app with a popupMenu
  2. Enable VoiceOver / Talkback
  3. Swipe until you get Dismiss Menu semantic

Expected results

Element should be labelled as button by VoiceOver/Talkback as it has an onTap action.

Actual results

Element is not labelled as button

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(MaterialApp(
    title: 'Flutter Demo',
    localizationsDelegates: const [
      GlobalMaterialLocalizations.delegate,
      GlobalWidgetsLocalizations.delegate,
      GlobalCupertinoLocalizations.delegate,
    ],
    debugShowCheckedModeBanner: false,
    supportedLocales: <Locale>[
      Locale('en', 'US'), // English
    ],
    home: MyApp(),
  ));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: TextButton(
          child: Text('Hello, World!'),
          onPressed: () {
            showMenu<String>(
              shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))),
              context: context,
              items: [PopupMenuItem(child: Text('Menu1')), PopupMenuItem(child: Text('Menu2'))],
              position: RelativeRect.fromLTRB(
                0,
                0,
                0,
                0,
              ),
            );
          },
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
RPReplay_Final1730796017.MP4
Capture d’écran 2024-11-05 à 13 55 01

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.3, on macOS 14.6.1 23G93 darwin-arm64, locale fr-FR)
    • Flutter version 3.19.3 on channel stable at /Users/jeremy_bastien/fvm/versions/3.19.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba39319843 (8 months ago), 2024-03-07 15:22:21 -0600
    • Engine revision 2e4ba9c6fb
    • Dart version 3.3.1
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/jeremy_bastien/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/jeremy_bastien/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode 15/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2024.1)
    • 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
    • android-studio-dir = /Applications/Android Studio.app
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • 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

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.5)
    • IntelliJ at /Users/jeremy_bastien/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 81.0.2
    • Dart plugin version 241.18968.26

[✓] Connected device (2 available)
    • macOS (desktop)                  • macos                     • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                     • chrome                    • web-javascript • Google Chrome 130.0.6723.92

[✓] Network resources
    • All expected network resources are available.
@Jerem42
Copy link
Author

Jerem42 commented Nov 5, 2024

It's most likely reproduced on the last Flutter release too seeing the source code for modal_barrier.dart on master branch.

One easy way to fix it would be to add to the Semantics of the ModalBarrier widget button: true when semanticsDismissible is true and semanticsLabel != null, but I'm not too sure what kind of effect it would have on other widgets using ModalBarrier

@Jerem42 Jerem42 changed the title [a11][VoiceOver/Talkback] Dismissable ModalBarrier is not announced as a button [a11y][VoiceOver/Talkback] Dismissable ModalBarrier is not announced as a button Nov 5, 2024
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Nov 5, 2024
@darshankawar
Copy link
Member

@Jerem42
Using your code and running on latest stable, tapping on hello world text isn't triggering the popup menu for some reason. Can you try the same or make updates to the code that will show it ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 5, 2024
@Jerem42
Copy link
Author

Jerem42 commented Nov 5, 2024

I just edited the code sample to make it work.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 5, 2024
@darshankawar
Copy link
Member

Thanks for the update. Upon running on Android and iOS, it reads dismiss menu, double tap to activate. Although upon focusing on menu inside dismissable, it reads correctly as button.

stable : 3.24.3
master : 3.27.0-1.0.pre.367

@darshankawar darshankawar added framework flutter/packages/flutter repository. See also f: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.24 Found to occur in 3.24 found in release: 3.27 Found to occur in 3.27 team-accessibility Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter) and removed in triage Presently being triaged by the triage team labels Nov 6, 2024
@chunhtai
Copy link
Contributor

chunhtai commented Nov 7, 2024

having a ontap doesn't necessary mean it is a button. We have to double check with native behavior

@chunhtai chunhtai added P3 Issues that are less important to the Flutter project triaged-accessibility Triaged by Framework Accessibility team labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) found in release: 3.24 Found to occur in 3.24 found in release: 3.27 Found to occur in 3.27 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project team-accessibility Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter) triaged-accessibility Triaged by Framework Accessibility team
Projects
None yet
Development

No branches or pull requests

3 participants