Repository navigation
Can't click on the items under the snackbar with margin #78537
Copy link
Copy link
Closed
Labels
found in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has partial patchThere is a PR awaiting someone to take it across the finish lineThere is a PR awaiting someone to take it across the finish linehas 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/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to Reproduce
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey =
GlobalKey<ScaffoldMessengerState>();
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: ScaffoldMessenger(
key: scaffoldMessengerKey,
child: Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
ElevatedButton(
onPressed: () {
scaffoldMessengerKey.currentState!.showSnackBar(
const SnackBar(
behavior: SnackBarBehavior.floating,
width: 300,
content: Text('Snackbar with width'),
),
);
},
child: const Text('Show snackbar with width'),
),
ElevatedButton(
onPressed: () {
scaffoldMessengerKey.currentState!.showSnackBar(
const SnackBar(
behavior: SnackBarBehavior.floating,
margin: EdgeInsets.fromLTRB(0, 0, 300, 0),
content: Text('Snackbar with margin'),
),
);
},
child: const Text('Show snackbar with margin'),
),
ElevatedButton(
onPressed: () {
print('onPressed');
},
child: const Text('Try press me'),
),
],
),
),
),
),
);
}
}Expected results:
The button below the snackbar cannot be clicked when decreasing the size of the snackbar via the margin.
This works when you decrease the size with the width.
Actual results:
Be able to click on the button below the snackbar when decreasing the size of the snackbar via the margin.
This works when you decrease the size with the width.
Logs
[+10475 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 0
[ +105 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 1
[ +995 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 0
[ +171 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 1
[ +445 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 0
[ +114 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 1
[+1059 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 0
[ +149 ms] I/ViewRootImpl@1de61f0[MainActivity]( 4048): ViewPostIme pointer 1
Analyzing poc...
No issues found! (ran in 2.0s)
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.3 20D91 darwin-x64, locale fr-FR)
• Flutter version 1.22.6 at /Users/lsaudon/development/flutter
• Framework revision 9b2d32b605 (il y a 8 semaines), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/lsaudon/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.9.3
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.54.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (1 available)
• SM T500 (mobile) • R9WNB0YFZCJ • android-arm64 • Android 10 (API 29)
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
found in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has partial patchThere is a PR awaiting someone to take it across the finish lineThere is a PR awaiting someone to take it across the finish linehas 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/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
pedromassangocode commentedon Mar 18, 2021
I can reproduce this on latest stable channel.
ScaffoldMesengerreproduce the issue as well.flutter doctor -v
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.3 20D91 darwin-x64, locale en-AO) • Flutter version 2.0.2 at /Users/pedromassango/Code/flutter_stable • Framework revision 8962f6dc68 (6 days ago), 2021-03-11 13:22:20 -0800 • Engine revision 5d8bf811b3 • Dart version 2.12.1 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/pedromassango/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/pedromassango/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [!] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e ! CocoaPods 1.9.3 out of date (1.10.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#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • 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 1.8.0_242-release-1644-b3-6915495) [✓] IntelliJ IDEA Community Edition (version 2020.3.2) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 54.0.3 • Dart plugin version 203.7759 [✓] VS Code (version 1.54.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.16.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 11.2.3 20D91 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90 ! Doctor found issues in 1 category.lsaudon commentedon Mar 18, 2021
Enregistrement.de.l.ecran.2021-03-18.a.15.40.01.mov
exaby73 commentedon May 16, 2022
Issue still persists on the latest stable and master channels.
Code sample
Video
78537_web_stable.mov
flutter doctor -v(Stable)flutter doctor -v(Master)miquelbeltran commentedon Oct 28, 2022
Probably related to this proposal as well: #92787
Hixie commentedon May 30, 2023
@MindMayhem wrote a partial patch for this in #114810. If anyone is interested in continuing that work, I'm sure it would be appreciated.
lsaudon commentedon Jun 22, 2023
I've been doing a pull request for a few weeks now.
Tap on button behind snack bar defined by margin (#127959)
bleroux commentedon Jul 14, 2023
Fixed by #127959
github-actions commentedon Jul 31, 2023
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.