Skip to content

[Accessibility] DropdownMenu - Focusable on leadingIcon when null #164905

@aferret0

Description

@aferret0

Steps to reproduce

  1. Implement a DropdownMenu
  2. Activate Talkback
  3. Navigate through DropdownMenu

Expected results

When leadingIcon is not passed as parameter to DropdownMenu, it should not be focusable with Talkback

Actual results

When leadingIcon is not passed as parameter to DropdownMenu, it's focusable with Talkback

Code sample

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

void main() {
  runApp(MyApp());
}

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

  final entries =
      List.generate(
        3,
        (i) => DropdownMenuEntry(label: "Item $i", value: i),
      ).toList();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text("Dropdown 1"),
              Center(child: DropdownMenu(dropdownMenuEntries: entries)),
              Text("Dropdown 2"),
              Center(child: DropdownMenu(dropdownMenuEntries: entries)),
              Text("Dropdown 3"),
              Center(
                child: DropdownMenu(
                  leadingIcon: Padding(
                    padding: const EdgeInsets.all(10.0),
                    child: Icon(Icons.loupe),
                  ),
                  dropdownMenuEntries: entries,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen_recording_20250310_153710.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
flutter doctor
                                                                                                                                                                           
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.3.1 24D70 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.97.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: material designflutter/packages/flutter/material repository.found in release: 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions