Skip to content

When interacting with a ExpansionTile using a screen reader, the status of the tile is not announced #120650

Description

@jiahaog

Internal bug: b/269139224

(Copied from the internal bug above)

The bug also happens on iOS devices.

Steps to Reproduce

  1. With an Android device or emulator with Talkback enabled.
  2. Focus on the collapsed/expanded ExpansionTile and verify what the screen reader announces.
  3. Double click to activate/collapse the ExpansionTile and verify the screen reader announcement.

Expected results:

The tile should read "double tap to expand", "double tap to collapse" when focused on it.
The tile should announce "expanded" or "collapsed" when clicking on it.

Actual results:

Screen reader is just reading "double tap to activate" when focused on the tile.
The tile doesn't announce anything when it's expanded or collapsed.

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        // We also apply a custom font, ProductSans.
        title: Text(widget.title, style: TextStyle(fontFamily: 'ProductSans')),
      ),
      body: Center(
        child: ExpansionTile(
          title: Text('Tile'),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    on Feb 14, 2023
  2. self-assigned this
    on Feb 14, 2023
  3. moved this from To do to In progress in Nevercodeon Feb 15, 2023
  4. TahaTesser commented on Feb 16, 2023

    @TahaTesser
    Contributor

    There is an existing issue tracking iOS issue where the ExpansionTile (ListTile as well) doesn't announce anything, please see #74963

  5. moved this from In progress to PR submitted in Nevercodeon Feb 16, 2023
  6. TahaTesser commented on Feb 16, 2023

    @TahaTesser
  7. moved this from PR submitted to Done (PR merged) in Nevercodeon Feb 27, 2023
  8. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 28, 2023
  9. 3 remaining items

  10. removed
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 28, 2023
  11. moved this from In progress to No status in Nevercodeon Feb 28, 2023
  12. moved this to In progress in Nevercodeon Feb 28, 2023
  13. added
    P2Important issues not at the top of the work list
    and removed
    P1High-priority issues at the top of the work list
    on Mar 9, 2023
  14. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Mar 17, 2023
  15. moved this from In progress to To do in Nevercodeon Mar 24, 2023
  16. TahaTesser commented on Mar 27, 2023

    @TahaTesser
    Contributor

    cc: @chunhtai
    Assigning this to you as well.

    In my investigation, it looks like this needs a complete fix, both regular ListTile and ExpansionTile don't announce the "double tap to" action #121636.
    While CheckboxListTile, SwitchListTile, and RadioListTile contains MergeSemantics, this does announce action.

    This would be much easier for you to fix and verify it doesn't break the widgets.

  17. github-actions commented on Apr 24, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  18. locked as resolved and limited conversation to collaborators on Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: huggsy (g3)frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions