Skip to content

Drag to dismiss bottom sheet: Some gesture Not working with a keyboard open #362

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

Open
mazzonem opened this issue Jan 30, 2025 · 5 comments
Labels
bug Something isn't working in triage

Comments

@mazzonem
Copy link

Bug report

Describe the bug
A clear and concise description of what the bug is. If applicable, please add screenshots/videos.

Steps to reproduce

Steps to reproduce the behavior:

  1. Open a bottom sheet page that contains a texfield
  2. autofocus or focus on the textfield
  3. slide down the bottom sheet to close but lift your finger only when above the open keyboard

Expected behavior

The bottom sheet should close. At the moment the sheet collapsed but stays opened (the keyboard is still visible).
onModalDismissedWithDrag is not called.


Additional context

My guess is that onModalDismissedWithDrag is only called when lifting the finger, but it's not registered when above the opened keyboard.


@mazzonem mazzonem added bug Something isn't working in triage labels Jan 30, 2025
@ulusoyca
Copy link
Contributor

ulusoyca commented Feb 2, 2025

Hi @mazzonem! Thanks for the report. DO you have time to investigate and fix? Otherwise I will try to a maintainer to investigate.

@elliothux
Copy link

Same issue here. When dragging down on the handle while an input inside the modal sheet is focused, _isDismissed in _handleVerticalDragEnd is true, preventing the onModalDismissedWithDrag callback from being triggered.

Image

@ulusoyca
Copy link
Contributor

ulusoyca commented Mar 8, 2025

@TahaTesser can you check this?

@TahaTesser
Copy link
Collaborator

@mazzonem
Thanks for the report! I'm trying to reproduce the issue with the provided instructions. I cannot get the keyboard to stay open as you mentioned on Android as well as iOS. Please watch the demo video below and let me know if I'm missing a step. Appreciate it!

IMG_9595.mov

Code Sample

expand to view the code sample
import 'package:flutter/material.dart';
import 'package:wolt_modal_sheet/wolt_modal_sheet.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: Builder(
              builder: (context) {
                return FilledButton(
                  onPressed: () {
                    showWoltDialog(context);
                  },
                  child: Text('Show Wolt bottom sheet'),
                );
              },
            ),
          ),
        ),
      ),
    );
  }
}

void showWoltDialog(BuildContext context) {
  WoltModalSheet.show(
    context: context,
    modalTypeBuilder: (context) => WoltModalType.bottomSheet(),
    pageListBuilder:
        (bottomSheetContext) => <SliverWoltModalSheetPage>[
          WoltModalSheetPage(
            child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: TextField(
                decoration: InputDecoration(
                  hintText: 'Enter some text',
                  border: OutlineInputBorder(),
                ),
              ),
            ),
          ),
        ],
  );
}

@elliothux
Copy link

elliothux commented Mar 12, 2025

ScreenRecording_03-12-2025.19-52-10_1.MP4

Hi @TahaTesser Check out this video—when the keyboard opens and you drag the sheet down, the sheet disappears, but the keyboard and the barrier remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in triage
Projects
None yet
Development

No branches or pull requests

4 participants