Skip to content

Fix ExpansionTile double tap to collapse/expanded and expanded/collapsed states semantics announcements #120881

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

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

TahaTesser
Copy link
Member

@TahaTesser TahaTesser commented Feb 16, 2023

fixes #120650

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: const Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              ExpansionTile(
                title: Text('Flutter Forward'),
                children: <Widget>[
                  FlutterLogo(size: 100),
                ],
              ),
              SizedBox(height: 20),
              ExpansionTile(
                initiallyExpanded: true,
                title: Text('Flutter Forward'),
                children: <Widget>[
                  FlutterLogo(size: 100),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Demo

telegram-cloud-document-5-6334536656577628266.mp4

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: internationalization Supporting other languages or locales. (aka i18n) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Feb 16, 2023
@TahaTesser TahaTesser added the a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) label Feb 16, 2023
@TahaTesser TahaTesser requested a review from jiahaog February 16, 2023 13:44
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked with google internal a11y guideline and looks like this is also required for Android

1.4
Consider providing accessibility hints, especially in cases where additional detail may be helpful in explaining a click or long-click action. This is accomplished by overriding a standard accessibility action with a custom label, which will be appended to TalkBack’s feedback after the View’s content is spoken.

For example, if clicking on a card expands its contents to show more detail, but this isn’t conveyed in TalkBack’s output because the card contains other text, applying an accessibility hint as follows would result in TalkBack appending “Double tap to expand for more details.”, which provides a more polished user experience.

For iOS, we should add a SemanticsProperties.hint. The onTapHint does not work on iOS.
https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/iPhoneAccessibility/Making_Application_Accessible/Making_Application_Accessible.html#//apple_ref/doc/uid/TP40008785-CH102-SW6

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@TahaTesser TahaTesser force-pushed the expansion_tile_semantics branch from f473f10 to ea9d305 Compare February 22, 2023 14:12
@TahaTesser
Copy link
Member Author

TahaTesser commented Feb 22, 2023

@chunhtai
Updated the PR for the onTapHint label, however for iOS, there is no hint for the list tile or related widgets such as the expansion tile so I want to fix the list tile and other widgets together in a separate PR.

(updated demo video)

@TahaTesser TahaTesser requested a review from chunhtai February 22, 2023 14:22
@TahaTesser TahaTesser force-pushed the expansion_tile_semantics branch from ea9d305 to cd89be2 Compare February 23, 2023 11:00
@TahaTesser TahaTesser force-pushed the expansion_tile_semantics branch from cd89be2 to ae5ec92 Compare February 27, 2023 08:45
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 27, 2023
@auto-submit auto-submit bot merged commit fd65fd1 into flutter:master Feb 27, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 27, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 27, 2023
@TahaTesser TahaTesser deleted the expansion_tile_semantics branch February 28, 2023 07:10
XilaiZhang added a commit that referenced this pull request Feb 28, 2023
XilaiZhang added a commit that referenced this pull request Feb 28, 2023
XilaiZhang added a commit to XilaiZhang/flutter that referenced this pull request Mar 1, 2023
XilaiZhang added a commit that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
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) a: internationalization Supporting other languages or locales. (aka i18n) autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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