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

ScrollView.keyboardDismissBehavior doesn't unfocus the keyboard properly #103544

Closed
Shawn-sudo opened this issue May 11, 2022 · 7 comments
Closed
Labels
r: solved Issue is closed as solved

Comments

@Shawn-sudo
Copy link

Steps to Reproduce

  1. Put keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag in a SingleChildScrollView, which has TextField among the children.
  2. Tap on the TextField to focus on it.
  3. Dismiss the keyboard by scrolling the page
  4. Open the drawer

Expected results:
When the drawer is opened, keyboard stays there

Actual results:
Keyboard pops out

IMG_4871.mp4

Similar Issue
#54277: This gives the solution to dismiss the keyboard properly, and I think the proper way of dismissing it is not applied on SingleChildScrollView's .onDrag code.

Code sample
    return Scaffold(
      appBar: AppBar(),
      drawer: Drawer(),
      body: SingleChildScrollView(
        keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
        child: SafeArea(
          child: Column(
            children: [
              TextFormField(),
            ],
          ),
        ),
      ),
    );
Logs
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 12, 2022
@darshankawar
Copy link
Member

@Shawn-sudo
Thanks for the report. Running your code sample on latest stable (3.0), I observed that when textfield is in focus, the keyboard opens as below:

Screenshot 2022-05-12 at 6 09 42 PM

And when we open drawer, the textfield becomes inactive as you can see in the background, it has greyed out and hence the keyboard closes.

Screenshot 2022-05-12 at 6 09 53 PM

which I think is an expected behavior. What exactly should be the expected result from your end ? Does the same occur in native iOS app if you could check and confirm ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 12, 2022
@Shawn-sudo
Copy link
Author

@darshankawar Oh did you scroll the page before opening the drawer? Cause it happened to me only when I 1. open the keyboard 2. close the keyboard by scrolling the SingleChildScrollView (which has keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag) 3. And then open the drawer

@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 May 13, 2022
@darshankawar
Copy link
Member

I can't scroll using the code sample you provided. Please provide complete code sample that shows the behavior.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 13, 2022
@Shawn-sudo
Copy link
Author

Umm Just put Column under the SingleChildScrollView add a bunch of SizedBox(height: 10000) under the Column.

@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 May 13, 2022
@darshankawar
Copy link
Member

See if this issue is similar to your case #57609

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 13, 2022
@Shawn-sudo
Copy link
Author

I think #57609 is different from what I'm talking about, but I think it would solve this issue in a broad way. Thx

@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 May 13, 2022
@darshankawar darshankawar added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels May 16, 2022
@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 May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests

2 participants