You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Add2App] The typed characters in a TextField are lost when backgrounding the app with focus on the TextField on Android #47137
Using the new embedding API for Android to embed Flutter in an existing app, it is possible for the TextField to lose its last typed characters when backgrounding the app on Android.
The following simple Flutter module code will create a TextField.
Launch the Flutter module in the existing app
Start typing text in the field
With focus still in the field, background the app using the Home button
Come back to the app. Notice the focus is still in the field and the keyboard is hidden, but the characters disappear.
If you take focus off of the TextField before backgrounding the app, then when coming back, the characters remain.
This is related to #35054, but the fix for that bug either introduced this or revealed it.
@dnfield any idea if there is some kind of flushing logic that takes place when removing focus from a textfield that therefore wouldn't be triggered upon app backgrounding?
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.
Activity
dannyvalentesonos commentedon Dec 16, 2019
@dnfield #35054 is fixed, but now this bug is happening.
Thanks
dnfield commentedon Dec 16, 2019
/cc @matthew-carroll @xster
dnfield commentedon Dec 16, 2019
@iapicca this is very unlikely to require input from the Android team :) removing the dependency label.
This probably needs changes in engine or framework, possibly both. Adding those.
matthew-carroll commentedon Dec 16, 2019
@dnfield any idea if there is some kind of flushing logic that takes place when removing focus from a textfield that therefore wouldn't be triggered upon app backgrounding?
dnfield commentedon Dec 16, 2019
This is reproducible for any app with the new embedding - it's not add2app specific.
dnfield commentedon Dec 16, 2019
I have a fix for this. Writing a test now.
dnfield commentedon Dec 16, 2019
@matthew-carroll - it's something like that, yes.
voiddog commentedon Dec 17, 2019
Same problem too
dnfield commentedon Dec 19, 2019
The fix for this introduced some other unexpected breakages. It's going to be reverted until I can work that out.
dnfield commentedon Dec 19, 2019
I believe I have another, safer fix for this.
github-actions commentedon Aug 24, 2021
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 -vand a minimal reproduction of the issue.