Skip to content

iOS Voice Control number label shown on parent widget with Semantic label when child widget is actionable #158477

Closed

Description

@franciscojma86

Steps to reproduce

  1. Create a parent widget, and wrap it in Semantics(label: 'Hello world)
  2. Add a child widget with an action, like TextButton
  3. Activate Voice Control on iOS
  4. Say "Show numbers"
  5. Notice a number is shown on the parent, and it has no actions

Expected results

The parent AND child widgets show a number label, even though the parent has no actions.

Actual results

Only child widget should show a number label, not the parent

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(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Repro examples'),
        ),
        body: Semantics(
          label: 'Example',
          container: true,
          child: Center(
            child: TextButton(
              child: const Text('Hello World'),
              onPressed: () {},
            ),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Activity

  1. franciscojma86 commented on Nov 11, 2024

    @franciscojma86
    ContributorAuthor

    b/368287225

  2. franciscojma86 commented on Nov 11, 2024

    @franciscojma86
    ContributorAuthor

    b/368205456

  3. franciscojma86 commented on Nov 12, 2024

    @franciscojma86
    ContributorAuthor

    b/367947743

    Might be related. When creating a ListTile, and adding a button as a children, the whole tile gains a number label as well, even if its onTap is null

    class MyApp extends StatelessWidget {
    
      final List<String> items = [
        'Popup menu example',
        'Overlay portal example',
        'Container example',
      ];
    
      @override
      Widget build(BuildContext context) {
    
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(
              title: const Text('Repro examples'),
            ),
            body: ListView.builder(
              itemCount: items.length,
              itemBuilder: (context, index) {
                final item = items[index];
                return ListTile(
                  title: Row(
                    children: [
                      IconButton(
                        icon: Icon(Icons.menu),
                        onPressed: () => print('Pressed'),
                      ),
                      Text(item),
                    ],
                  ),
                  onTap: null,
                );
              },
            ),
          ),
        );
      }
    }
    

    In this example, only the IconButton should show a number, not the whole cell.

    Screenshot 2024-11-11 at 4 59 55 PM

  4. added
    in triagePresently being triaged by the triage team
    on Nov 12, 2024
  5. huycozy commented on Nov 12, 2024

    @huycozy
    Member

    I can reproduce this issue (similar to the demo screenshot at the 1st comment) on Flutter stable 3.24.4 and beta 3.27.0-0.1.pre (can't check on master because there is another error that prevents running app on iOS app)

    And I think the actual result and expected result in the first comment are reversed.

    Reproduced this on iOS with Voice Control. On Android with Voice Access, there is only one label on the button (as expected). This may be similar or has the same cause as #157630.

    Flutter versions (stable and beta)
    [✓] Flutter (Channel stable, 3.24.4, on macOS 15.0.1 24A348 darwin-x64, locale en-VN)
        • Flutter version 3.24.4 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 603104015d (12 hours ago), 2024-10-24 08:01:25 -0700
        • Engine revision db49896cf2
        • Dart version 3.5.4
        • DevTools version 2.37.3
    [!] Flutter (Channel beta, 3.27.0-0.1.pre, on macOS 15.0.1 24A348 darwin-x64, locale en-VN)
        • Flutter version 3.27.0-0.1.pre on channel beta at /Users/huynq/Documents/GitHub/flutter_beta
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_beta. Consider adding /Users/huynq/Documents/GitHub/flutter_beta/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_beta. Consider adding /Users/huynq/Documents/GitHub/flutter_beta/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 2e2c358c9b (2 weeks ago), 2024-10-22 11:02:13 -0400
        • Engine revision af0f0d559c
        • Dart version 3.6.0 (build 3.6.0-334.3.beta)
        • DevTools version 2.40.1
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
  6. added
    platform-iosiOS applications specifically
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    fyi-iosFor the attention of iOS platform team
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Nov 12, 2024
  7. franciscojma86 commented on Nov 12, 2024

    @franciscojma86
    ContributorAuthor

    Yeah, sorry, I mixed expected with actual :)

  8. added
    team-iosOwned by iOS platform team
    and removed
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    on Nov 14, 2024
  9. chunhtai commented on Nov 14, 2024

    @chunhtai
    Contributor

    cc @jmagman

    I can't tell why voice control decides to give a label to a accessibilityElement without any action. We may need someone from iOS team to look into this.

    This seems quite bad as the voice control users may see this a lot.

  10. flutter-triage-bot commented on Nov 15, 2024

    @flutter-triage-bot

    The fyi-ios label is redundant with the team-ios label.

  11. added
    P1High-priority issues at the top of the work list
    on Dec 18, 2024
  12. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 26, 2025
  13. github-actions commented on Mar 12, 2025

    @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.

  14. locked as resolved and limited conversation to collaborators on Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: quake (g3)found in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.has 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 teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions