-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[iOS] Fixed Using safe area causes white area at the top upon entry focus #26063
base: main
Are you sure you want to change the base?
[iOS] Fixed Using safe area causes white area at the top upon entry focus #26063
Conversation
Hey there @devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
||
// no need to move the screen down if we can already see the view | ||
if (move < 0) | ||
{ | ||
move = 0; | ||
} |
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.
I don't think we'd want to always ignore this move down when we are in the safeArea space. Also consider when we are in a scrollview and we want the standard safe area and the next entry is in the top safe area space. In this example, we would expect that the scrollview scrolls down. Perhaps we can see if the IgnoreSafeArea is set, then we can change that top boundary?
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.
I'll revisit the implementation and analyze an alternate fix to restrict unnecessary scrolling when the keyboard opens. I'll ensure the behavior accommodates scenarios like ScrollView scrolling into the safe area correctly when required.
Root Cause
When an Entry is focused and the keyboard opens, the view adjusts and scrolls downward, causing a white space to appear at the top of the screen.
Description of Change
In the AdjustPosition method, the move value is calculated when CursorRect.Y is less than topBoundary and CursorRect.Bottom is also less than bottomBoundar, which lead to unnecessary scrollling. To address this, a condition was added to ensure that if the move value is less than 0, it is reset to 0.
Issues Fixed
Fixes #25866
Validated the behaviour in the following platforms
UseSafeArea and IgnoreSafeArea are most relevant on iOS alone due to the unique layout constraints of safe areas.
Output Screenshot