Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff changes the textinput component to only scroll (and interrupt parent views from scrolling), when it is possible for the text inside the component to be scrolled. Before (D3735237), we would intercept all touch events on the textinput if it's focused. But this makes it: a.) impossible to scroll a scrollview from within a textinput that cannot be scrolled; b.) different from iOS behavior. What the component now does is intercept move touches, and check if it can scroll in any direction. If it does, it will intercept the touches and stop the parent component from scrolling; otherwise, it will give the control back to the parent component. Note: this might change in the future to also detect the direction of the scroll, and only block the scroll if the component can scroll in that direction. This is however not trivial, since the scroll needs to be above some threshold of pixels. Blocking the parent view from scrolling until that threshold is passed might cause incorrect behavior in the parent component. Reviewed By: astreet Differential Revision: D3764267 fbshipit-source-id: 47e7b5e03855b3c85789e04fc31a8317afbafa84
- Loading branch information