Skip to content

Commit

Permalink
Fix requestDisallowInterceptTouchEvent for nested react native views
Browse files Browse the repository at this point in the history
Summary:
ReactRootView currently intercepts and swallows all
`requestDisallowInterceptTouchEvent` calls, which made sense when the
ReactNativeView was the root of all views. In the context of react native views
embedded in other views though, we want to propagate the call to all parents
views, but not set it on the ReactRootView itself (because we still need the
`onInterceptTouchEvent` calls to dispatch the touch events to JS).

Reviewed By: foghina

Differential Revision: D3819255

fbshipit-source-id: 21f2dd173c76e98342193de384292fef2b407250
  • Loading branch information
andreicoman11 authored and Facebook Github Bot 0 committed Sep 6, 2016
1 parent 372d001 commit dea6b0e
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -161,8 +161,11 @@ private void dispatchJSTouchEvent(MotionEvent event) {

@Override
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
// No-op - override in order to still receive events to onInterceptTouchEvent
// even when some other view disallow that
// Override in order to still receive events to onInterceptTouchEvent even when some other
// views disallow that, but propagate it up the tree if possible.
if (getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(disallowIntercept);
}
}

@Override
Expand Down

0 comments on commit dea6b0e

Please sign in to comment.