-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix Crashing issue with keyboard scrolling iOS #28148
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.
PR Overview
This PR addresses a crash caused by keyboard dismissal when the associated editor/entry's window is null by adding additional null-checks.
- Added responder window null-checks in ViewExtensions.cs.
- Updated the condition in KeyboardAutoManagerScroll.cs to verify that LastScrollView’s window is not null before proceeding with animations.
Reviewed Changes
File | Description |
---|---|
src/Core/src/Platform/iOS/ViewExtensions.cs | Introduces window null-checks in the responder chain to avoid accessing disposed views (note: using "return null;" in a void method could be problematic). |
src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs | Adjusts the keyboard hiding animation invocation by verifying that LastScrollView is attached to a window. |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/Core/src/Platform/iOS/ViewExtensions.cs:772
- Returning null from a method declared with a void return type is a compile error; consider using 'return;' instead or update the method's return type if a null value is intended.
return null;
src/Core/src/Platform/iOS/ViewExtensions.cs:792
- Returning null from a method declared with a void return type is a compile error; consider using 'return;' instead or update the method's return type if a null value is intended.
return null;
* check the window * check each responders window * check LastScrollView Window
* check the window * check each responders window * check LastScrollView Window
Description of Change
This PR adds some checks so that we don't crash when the an editor/entry is unfocused and the keyboard goes away, but that editor/entry's Window is null. This one is pretty tricky to test so we may just add this now and keep trying on the test.
Issues Fixed
Fixes #28140