Repository navigation
CupertinoButton does not handle VoiceOver taps correctly on iOS #170348
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues 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.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamTriaged by Framework Accessibility team
Description
Steps to reproduce
- Create a project using
flutter create(Flutter version 3.32.2 in my case) - Edit
main.dartChange from FloatingActionButton to CupertinoButton, remove tooltip property and import 'package:flutter/cupertino.dart' - Run on iOS device, enable VoiceOver and attempt to click the button with a double tap.
Expected results
I expect the button to be pressed and increment the number as per the default flutter app
Actual results
The button appears to get pressed by a double tap but the onPressed function is never called. A triple tap (long press equivalent) does technically work but is the incorrect way to activate the button.
Code sample
Code sample
import 'package:flutter/cupertino.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(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('You have pushed the button this many times:'),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
// This is the default app with the comments removed and the FloatingActionButton replaced with a CupertinoButton
floatingActionButton: CupertinoButton(
onPressed: _incrementCounter,
child: const Icon(Icons.add),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.2, on macOS 15.5 24F74 darwin-arm64, locale en-US)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/macos-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[!] Xcode - develop for iOS and macOS (Xcode 16.2)
! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
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
To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.98.2)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for iPhone 14 pro max. 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
! Doctor found issues in 3 categories.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues 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.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamTriaged by Framework Accessibility team
Activity
sonicseaweed commentedon Jun 10, 2025
If I comment out lines 377 and 379 from the cupertino button file https://github.com/flutter/flutter/blob/flutter-3.32-candidate.0/packages/flutter/lib/src/cupertino/button.dart#L377 then it all works as expected, so it may be a clue :)
[-]CupertinoButton does not handle VoiceOver taps correctly[/-][+]CupertinoButton does not handle VoiceOver taps correctly on iOS[/+]darshankawar commentedon Jun 11, 2025
Thanks for the report. Seeing the same behavior as reported with latest sdk versions.
chunhtai commentedon Jun 11, 2025
This seems like a serious issue, will need more investigation to see what is going on
chunhtai commentedon Jun 12, 2025
regression cause by #161731
but this is a bug in rawgesturedetector surfaced by the pr that it sends incorrect tap up event position
Fix RawGestureDetector semantics (#170549)
github-actions commentedon Jul 2, 2025
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 -vand a minimal reproduction of the issue.Fix RawGestureDetector semantics (flutter#170549)
Fix RawGestureDetector semantics (#170549)