Skip to content

Commit

Permalink
add edge case where we have small editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tj-devel709 committed Sep 16, 2024
1 parent 3884ced commit ef5db99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Core/src/Platform/iOS/KeyboardAutoManagerScroll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,15 @@ internal static void AdjustPosition()
var superScrollInContainer = ContainerView.ConvertRectFromView(superScrollView.Frame, superScrollView.Superview);
superScrollViewRect = ContainerView.ConvertRectToView(superScrollInContainer, null);
topBoundary = Math.Max(topBoundary, superScrollViewRect.Value.Top);
bottomBoundary = Math.Min(bottomBoundary, superScrollViewRect.Value.Bottom - TextViewDistanceFromBottom);
var superScrollViewBottom = superScrollViewRect.Value.Bottom - TextViewDistanceFromBottom;

// if the superScrollView is a small editor, it may not make sense to scroll the entire screen if cursor is visible
if (superScrollView is UITextView && superScrollViewRect.Value.Bottom - TextViewDistanceFromBottom < cursorRect.Bottom)
{
superScrollViewBottom = superScrollViewRect.Value.Bottom;
}

bottomBoundary = Math.Min(bottomBoundary, superScrollViewBottom);
}

bool forceSetContentInsets = true;
Expand Down

0 comments on commit ef5db99

Please sign in to comment.