-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Scroll text fields into view when keyboard comes up and obscures them #10826
Comments
@Hixie is there anything Posse can do to work around this bug? This specific instantiation is currently considered as a high priority issue. |
Not really. Mark it a blocker and I'll fix it in the next week or two. (I'm working on deep linking bugs right now, which I understand are also a high priority.) |
There's a workaround that should get around this:
This is inspired by how the Flutter UI codelab works (we want to use the bottom of the Unfortunately, it can introduce a new bug if the scrolling pushes the text fields upwards and they end up getting hidden by the top. If you only have a few text fields and they're at the bottom of your |
You can use a |
Thanks @collinjackson . The SingleChildScrollView workaround makes my form useable. The fix would be great so that the text fields aren't hidden requiring the user to scroll the field into view. |
I've begun work on this issue.
|
I've a patch that does almost all of this. The two remaining bits are actually scrolling the text field into view, and handling text fields that have decorations because the reparenting is causing some sort of bug in my code and prematurely ejecting the row. |
Ok, figured out the bug. Now I just need to do the scrolling into view part! |
Here is an example for scrolling focused widgets into view. Should only be useful while this issue is still being worked on. |
Workaround is in place so I removed the customer blocker label, but they would still like this fixed so we can remove the workaround. |
I am too facing this (Tapping into TextFormFields inside SingleChildScrollView causes keyboard to show and immediately hide) problem with the keyboard. It was working fine previously but right now this problem is happing with the same piece of code. |
@Rishab-1065 if you're using the workaround I posted above, try increasing the delay on line 57 from 300ms to a larger value. There's a race condition that could probably be removed with some effort but hopefully the framework-level fix will arrive soon. |
I have this problem but it's a TextField in an Expanded in a Column with a Row and Divider in an Expanded in a Column. |
This bug is still around. The tree hierachy looks like this : When the textfiled is at the bottom the keyboard will just hide it. The same bug is still around in the Flutter codelabs. |
@eddywm which branch/channel did you test this in? it's not in beta yet. |
@acidjazz I'm on the beta branch.
|
@eddywm i think you have to wait until its in that branch, i believe this fix is only in the dev branch. if you want, try |
It's fixed and text fields aren't obscured by the keyboard anymore, but I have another problem. Below text field I have button that I want to be visible when keyboard appears. Is there a way to add a offset to a point where it scrolls to make it scroll a little higher, or manually scroll so a button is above keyboard? Any other solution to this? |
@dankop123 https://github.com/flutter/flutter/pull/18562/files should allow that with added |
@zoechi Thanks! |
I still have this issue, how can i fix it? |
@joaovirgili |
Thank you for posting your reply @collinjackson. I had the same problem. However, I was using ListView.builder, so it wasn't just like you did, but this workaround worked for me:
|
Actually, there was a few issues with this after testing, but adding |
How can I put my form centered and when the keyboard is shown put all up of the keyboard? |
Thank You Brother. you solved my problem i had the issue like my error messages are gone, i have more form fields in form after clicking button i showing error to user, after scrolling to down and scroll upwards my errors are missing. |
on the latest version, was working without any issues now appears to have returned. please advise? |
In my case I realized when I had windowFullscreen style attribute of the |
Any update? |
Don't know if this is still an issue, but it was for me today with the stable sdk branch. I noticed that the |
@hazzo Can you explain with little code please? |
@Blacktoviche something like this should do the trick:
|
Thankx @hazzo but unfortunately it didn't work. But my code worked fine after little investigating about the problem cause. |
Wrap your widget inside |
This worked just fine, kept the list in same order. However need to do a |
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 |
I have several TextFormFields in a ListView, and it seems that if I tap into fields near the bottom (fields that would be obscured by the keyboard), the keyboard will appear and then immediately hide. I’m guessing it’s because it’s scrolling the list view which then causes the keyboard to dismiss. I've modified the flutter gallery text field demo and attached a video. Happens on both iOS and Android.
text_field_movie.zip
The text was updated successfully, but these errors were encountered: