Skip to content
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

ScrollViewKeyboardDismissBehavior.onDrag has not the smooth iOS behavior #96033

Closed
Tom3652 opened this issue Jan 2, 2022 · 5 comments
Closed
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@Tom3652
Copy link

Tom3652 commented Jan 2, 2022

Steps to Reproduce

  1. Run the sample code
  2. Tap the CupertinoTextField to gain focus
  3. Start dragging the ListView in any direction
  4. See the keyboard is killed instead of following the finger gesture

Expected results:

The keyboard should be dismissed like on a native iOS keyboard, following the finger dragging gesture.

Actual results:

The onDrag is killing not smoothly the keyboard instead of dragging it.

Code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Stack(
          children: [
            ListView(
              keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
              children: [
                Container(
                  color: Colors.red,
                  height: 200,
                  child: const Center(child: Text("First")),
                ),
                Container(
                  color: Colors.blue,
                  height: 200,
                  child: const Center(child: Text("Second")),
                ),
                Container(
                  color: Colors.yellow,
                  height: 200,
                  child: const Center(child: Text("Third")),
                ),
                Container(
                  color: Colors.green,
                  height: 200,
                  child: const Center(child: Text("Fourth")),
                ),
                Container(
                  color: Colors.pink,
                  height: 200,
                  child: const Center(child: Text("Fifth")),
                ),
              ],
            ),
            SafeArea(
              child: Align(
                alignment: Alignment.bottomCenter,
                child: SizedBox(
                  height: 50,
                  child: CupertinoTextField(
                    placeholder: "Tap me",
                    decoration: BoxDecoration(
                        color: Colors.purple,
                        borderRadius: BorderRadius.circular(15)),
                  ),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
Logs
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale fr-FR)
    • Flutter version 2.8.1 at /Users/foxtom/Desktop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (2 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/foxtom/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.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 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.63.2)
    • VS Code at /Users/foxtom/Desktop/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (3 available)
    • Now You See Me (mobile) • 00008020-001204401E78002E • ios            • iOS 15.2 19C56
    • macOS (desktop)         • macos                     • darwin-x64     • macOS 12.1 21C52 darwin-x64
    • Chrome (web)            • chrome                    • web-javascript • Google Chrome 96.0.4664.110

• No issues found!
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jan 3, 2022
@darshankawar
Copy link
Member

@Tom3652
Verified this case as below. On non-Flutter app, while the keyboard is enabled and if we drag, the keyboard is still active and follows the drag direction as below:

RPReplay-Final1641198267.MP4

In Flutter, below behavior is observed:

RPReplay-Final1641198314.MP4

Is this the correct interpretation of this issue ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 3, 2022
@Tom3652
Copy link
Author

Tom3652 commented Jan 3, 2022

Hi @darshankawar, yes it is the correct interpretation thank you !

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 3, 2022
@darshankawar
Copy link
Member

I looked for the current behavior again and found out this original issue that talks about the same scenario as yours.
I suggest you to follow-up in that issue for further updates.
Closing this as a duplicate.

@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels Jan 4, 2022
@Tom3652
Copy link
Author

Tom3652 commented Jan 4, 2022

Thanks @darshankawar !

Sorry i even forgot that i wrote there... I simply created this issue because of feedback from beta testers.

@github-actions
Copy link

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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants