Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Conversation

pinarol
Copy link
Collaborator

@pinarol pinarol commented Mar 21, 2019

To fix: wordpress-mobile/gutenberg-mobile#717

Autoscroll should only occur if the focused textInput is a subview of the scroll view. React native's UIManager.viewIsDescendantOf makes the check using shadows views and it generates true even if our TextInput is inside a new modal UIViewController, we don't want that. We just want a simple subview check like this: https://developer.apple.com/documentation/uikit/uiview/1622521-isdescendant

So we are replacing that check to avoid unwanted autoscrolls triggered from views that doesn't belong to our scrollview.

Test with:
gutenberg-mobile PR wordpress-mobile/gutenberg-mobile#767
WPiOS PR wordpress-mobile/WordPress-iOS#11298

Copy link

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

Works like a charm 🎉
Also smoke-tested Android to be sure everything works fine.

@pinarol pinarol merged commit e654f97 into master Mar 21, 2019
@pinarol pinarol deleted the fix/prevent-autoscroll-for-other-viewcontrollers branch March 21, 2019 14:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS]Opening the links bottom sheet causes the focused text get out of the viewable area
2 participants