-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception and modal barrier staying open when keyboard comes up while sheet closing animation. #140
Comments
Hi @SebastianEngel, I have released a new version 0.6.0 which contains several improvements in modal sheets. Could you test it and confirm if the problem is fixed or still exists? |
Thanks @fujidaiti We tried it. Unfortunately the problem is still there.
|
To summarize again: We have a screen A with a textfield. On this screen the user can tap a button to open a sheet. The sheet then partly covers the screen. The textfield in screen A is not directly covered by the sheet contents, but by the sheet's modal barrier. As its is half-transparent, we can see the textfield behind the barrier. When the user now taps on the field, or anywhere on the background the sheet closes just fine. But when the user double taps (two fast taps) on the field, the sheet closes but the barrier stays up, making the screen unusable. The log shows the posted exceptions. I suspect that it has something to do with the keyboard that pops up when the textfield receives focus, as then the dimensions change, probably while the sheet closing animation is still in progress. |
I tweaked the ai playlist generator example to have a text field on the background of the modal sheet, but couldn't reproduce the error. Can you post a code snippet related to your sheet? Then I could be of more help. RocketSim_Recording_iPhone_15_6.1_2024-05-29_11.01.48.mp4Here's the patch I applied to the ai playlist generator example. diff --git forkSrcPrefix/cookbook/lib/showcase/ai_playlist_generator.dart forkDstPrefix/cookbook/lib/showcase/ai_playlist_generator.dart
index a0188d788081b784b43f3bca0f01de14b0848a10..99db164e6fb3401a80c59357e7435f11bf79db41 100644
--- forkSrcPrefix/cookbook/lib/showcase/ai_playlist_generator.dart
+++ forkDstPrefix/cookbook/lib/showcase/ai_playlist_generator.dart
@@ -132,10 +132,18 @@ class _Root extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
- body: Center(
- child: ElevatedButton(
- onPressed: () => context.go('/intro'),
- child: const Text('Generate Playlist'),
+ body: SafeArea(
+ child: Center(
+ child: Column(
+ children: [
+ TextFormField(),
+ const SizedBox(height: 60),
+ ElevatedButton(
+ onPressed: () => context.go('/intro'),
+ child: const Text('Generate Playlist'),
+ ),
+ ],
+ ),
),
));
}
@@ -178,7 +186,7 @@ class _SheetShell extends StatelessWidget {
return SafeArea(
bottom: false,
child: PopScope(
- canPop: false,
+ canPop: true,
onPopInvoked: (didPop) async {
if (!didPop) {
final shouldPop = await showCancelDialog() ?? false; |
Hi @SebastianEngel, someone posted an issue similar to this one with a screenshot (#152). |
Yes, it's my colleague and the same issue 👍🏻 |
Closing this as a duplicate of #152. |
We have a sheet that covers half of the screen. When the user now double-taps on a textfield that is covered by the half-transparent barrier, A) the sheet closing animation starts and B) the soft keyboard comes up, both at the same time. This results in the barrier staying open (and the user unable to use the app) and the following exception in the logs:
This happened on version
0.4.1
as well as the current0.5.3
.Might be related to #14.
The text was updated successfully, but these errors were encountered: