Open 2ZeroSix opened 4 years ago
Thanks for discovering this! Indeed, this also affect the Scaffold
widget. I pushed a potentially simpler fix to the foreground-blink
branch. Can you see if that does the trick?
@martinrybak unfortunately this simpler fix introduce a bug:
result: widgets act like the keyboard is still open
Can you pull and try it again? Seems to work with the following use cases on iPhone 11 simulator running iOS 13.3:
For “other app”, I am using the News
app (textfield on the Following
tab).
Test case 1
Test case 2
Test case 3
@martinrybak same issue :( iOS 13.4 In this test case where "other app" is Settings (search field at the top the same as in the gifs above)
Test case 1
- Open soft keyboard in other app
- Open soft keyboard in sample app
- Dismiss soft keyboard in other app
- Return to sample app, keyboard should close
I added a debounce as you suggested. Can you take another look?
@2ZeroSix does the latest on foreground-blink
solve the issue? Thanks.
Yep, it does solve it for me 🎉, but I found another (pretty rare) scenario: Open example app and instantly change state of the keyboard, resize is just lost and layout stay the same. (in this pr it works as expected)
Do you mind if I try to modify your solution (as it seems much cleaner than mine) and create another PR?
Yes, by all means!
Fix for keyboard blinking issue. Added short debounce in
didChangeMetrics
calls when life cycle state is changed to.resumed
.before
after
might help to workaround this issue with default scaffolds
resizeToAvoidBottomInset
behavior: https://github.com/flutter/flutter/issues/53565