Skip to content
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

[SuperEditor][Android] Fix auto-scrolling start region (Resolves #2000) #2036

Merged
merged 2 commits into from
May 26, 2024

Conversation

angelosilvestre
Copy link
Collaborator

[SuperEditor][Android] Fix auto-scrolling start region. Resolves #2000

On Android, the auto-scrolling only starts when the user drags near the top of the screen. This causes problems when there are widgets above the editor, like an AppBar:

before.webm

The reason is that we are not converting the Offset to the offset inside the viewport.

This PR fixes the issue by converting the Offset:

after.webm

/// If this widget doesn't have an ancestor `Scrollable`, then this
/// widget includes a `ScrollView` and this `State`'s render object
/// is the viewport `RenderBox`.
RenderBox get viewportBox =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have similar mapping methods in other widgets. Is it usually declared above initState()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and we declare below dispose. Updated.

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android interactor assumes global positions which delays auto scrolling
2 participants