-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[web] Fix resizeToAvoidBottomInset on Android web
#179581
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a regression on Android web where resizeToAvoidBottomInset was not functioning correctly when the virtual keyboard is displayed. The fix ensures that the view's physicalSize is not updated by framework-initiated resizes while the keyboard is active, preserving the correct layout behavior. The changes include renaming methods for clarity, such as _didResize to _handleBrowserResize, and introducing a new getter _shouldPreservePhysicalSizeOnResize to encapsulate the logic. Additionally, an assertion has been added to detect negative viewInsets early, improving debuggability. A new regression test is also included to verify the fix. The changes are logical and well-implemented. My review includes a few suggestions to align the code with Effective Dart style guidelines.
harryterkelsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #175074
There was an implicit expectation in the resizing code: When the virtual keyboard is up on mobile, the view's
physicalSizeremains fixed, and any resizes (presumably caused by the virtual keyboard itself) should be considered asviewInsets.This expectation was broken inadvertently by my PR: #172493
The sequence of events that lead to the reported issue:
resizeToAvoidBottomInsetis true, the framework will re-render its content to fit the available size.physical height - bottom inset.The fix involves the following: