Skip to content

Semantics focus in DropdownButton is blinking after the focused widget is updated #174698

@huycozy

Description

@huycozy

Steps to reproduce

  1. Run sample code
  2. Turn on a reader. I tested with Android TalkBack
  3. Move focus to DropdownButton and select an item

Expected results

Semantics focus (green rect) should not be blinking, should focus on widget one time only.

Actual results

Semantics focus is blinking on DropdownButton after selecting an item.

Code sample

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(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int? _value;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        leading: IconButton(
          onPressed: () {},
          icon: const Icon(Icons.arrow_back),
        ),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              DropdownButton<int>(
                value: _value,
                onChanged: (value) {
                  setState(() {
                    _value = value;
                  });
                },
                hint: const Text("Open dropdown to select an item"),
                items: const [
                  DropdownMenuItem(child: Text("Dummy 1"), value: 1),
                  DropdownMenuItem(child: Text("Dummy 2"), value: 2),
                  DropdownMenuItem(child: Text("Dummy 3"), value: 3),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Record_2025-08-27-13-57-19_2d79911f0b1c5b412e0e86affadcb8b3.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel master, 3.36.0-1.0.pre-286, on macOS 15.5 24F74 darwin-arm64, locale en-US) [2.2s]
    • Flutter version 3.36.0-1.0.pre-286 on channel master at /Users/huym4/Documents/WORKING/SDK/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huym4/Documents/WORKING/SDK/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huym4/Documents/WORKING/SDK/flutter_master. Consider adding /Users/huym4/Documents/WORKING/SDK/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huym4/Documents/WORKING/SDK/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huym4/Documents/WORKING/SDK/flutter_master. Consider adding /Users/huym4/Documents/WORKING/SDK/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 060bf9dca0 (55 minutes ago), 2025-08-27 02:03:09 -0400
    • Engine revision 060bf9dca0
    • Dart version 3.10.0 (build 3.10.0-142.0.dev)
    • DevTools version 2.50.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [786ms]
    • Android SDK at /Users/huym4/Library/Android/sdk
    • Emulator version 35.5.10.0 (build_id 13402964) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • ANDROID_HOME = /Users/huym4/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[!] Xcode - develop for iOS and macOS (Xcode 16.2) [300ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    ✗ CocoaPods not installed.
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation

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

[✓] Connected device (3 available) [5.7s]
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos            • darwin-arm64   • macOS 15.5 24F74 darwin-arm64
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 139.0.7258.140
    ! Error: Browsing on the local area network for Huy’s iPhone 15 Pro. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [369ms]
    • All expected network resources are available.

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: material designflutter/packages/flutter/material repository.found in release: 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions