Semantics focus in DropdownButton is blinking after the focused widget is updated
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
### 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
```dart
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 {
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: [
DropdownButton(
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
https://github.com/user-attachments/assets/00eaa301-fd71-4c68-b7f0-7771218b96ca
### Logs
Logs
```console
[Paste your logs here]
```
### Flutter Doctor output
Doctor output
```console
[!] 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.
```
Contributor guide
Assessment
This issue has not been assessed yet.