Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.19Found to occur in 3.19Found to occur in 3.19found in release: 3.22Found to occur in 3.22Found to occur in 3.22has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Steps to reproduce
- Make an app with
SemanticsBinding.instance.ensureSemantics()in themainfunction. - Create a
RadioListTilewith a tappable Widget as asecondaryattribute. - Try to interact with a
secondaryWidget.
Expected results
The interaction is successful - the onTap callback of the secondary widget is called; the onChanged callback of the RadioListTile is not called.
Actual results
The interaction is unsuccessful - the onTap callback of the secondary widget is not called; the onChanged callback of the RadioListTile is called.
Tab-key interaction still works, though.
The ExcludeSemantics widget helps - but we lose the semantics.
It happens on Flutter starting at 3.19.0
It looks like the issue is the MergeSemantics widget inside the RadioListTile. In the example, I added regular ListTile, which works, and ListTile within MergeSemantics, which also behaves in the broken manner described above.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// Flutter code sample for [RadioListTile].
void main() {
runApp(const RadioListTileApp());
SemanticsBinding.instance.ensureSemantics();
}
class RadioListTileApp extends StatelessWidget {
const RadioListTileApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('RadioListTile Sample')),
body: const RadioListTileExample(),
),
);
}
}
enum SingingCharacter { lafayette, jefferson }
class RadioListTileExample extends StatefulWidget {
const RadioListTileExample({super.key});
@override
State<RadioListTileExample> createState() => _RadioListTileExampleState();
}
class _RadioListTileExampleState extends State<RadioListTileExample> {
SingingCharacter? _character = SingingCharacter.lafayette;
SingingCharacter _character2 = SingingCharacter.lafayette;
SingingCharacter _character3 = SingingCharacter.jefferson;
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
RadioListTile<SingingCharacter>(
title: const Text('Lafayette'),
value: SingingCharacter.lafayette,
groupValue: _character,
onChanged: (SingingCharacter? value) {
setState(() {
_character = value;
});
},
secondary: IconButton(
icon: const Icon(Icons.volcano),
onPressed: () {
showDialog(
context: context,
builder: (context) =>
SimpleDialog(children: [Text('dialog RadioListTile')]),
);
}),
),
MergeSemantics(
child: ListTile(
title: Text('MergedSemantics + ListTile ${_character2.toString()}'),
onTap: () {
setState(() {
_character2 = _character2 == SingingCharacter.jefferson
? SingingCharacter.lafayette
: SingingCharacter.jefferson;
});
},
trailing: IconButton(
icon: const Icon(Icons.volcano),
onPressed: () {
showDialog(
context: context,
builder: (context) => SimpleDialog(children: [
Text('dialog ListTile inside MergedSemantics')
]),
);
}),
),
),
ListTile(
title: Text('ListTile ${_character3.toString()}'),
onTap: () {
setState(() {
_character3 = _character3 == SingingCharacter.jefferson
? SingingCharacter.lafayette
: SingingCharacter.jefferson;
});
},
trailing: IconButton(
icon: const Icon(Icons.volcano),
onPressed: () {
showDialog(
context: context,
builder: (context) =>
SimpleDialog(children: [Text('dialog regular ListTile')]),
);
}),
),
],
);
}
}
Screenshots or Video
Screenshots / Video demonstration
Screen.Recording.2024-04-01.at.13.45.10.mov
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.19.4, on macOS 13.6 22G120 darwin-x64, locale en-UA)
• Flutter version 3.19.4 on channel stable at /Users/username/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 68bfaea224 (12 days ago), 2024-03-20 15:36:31 -0700
• Engine revision a5c24f538d
• Dart version 3.3.2
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/username/Library/Android/sdk
• Platform android-34, build-tools 33.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
! CocoaPods 1.10.0 out of date (1.13.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods for instructions.
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.87.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 13.6 22G120 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87
[✓] Network resources
• All expected network resources are available.Reacted by Leandro Novak and Álvaro Prado
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.19Found to occur in 3.19Found to occur in 3.19found in release: 3.22Found to occur in 3.22Found to occur in 3.22has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Activity
darshankawar commentedon Apr 1, 2024
Thanks for the report. I was able to replicate this on latest stable and master versions, whereas, on stable 3.16 version, tapping on all icons opens dialog, unlike in latest stable.
Maybe it is related to flutter-team-archive/engine#47360
stable, master flutter doctor -v
fix: prefer pointer events over semantics tap for mouse clicks on web (…