mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 02:04:55 +00:00
Fix requestDisallowInterceptTouchEvent
for nested react native views
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
This commit is contained in:
parent
372d001a5d
commit
dea6b0e24c
@ -161,8 +161,11 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
|
||||
@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
|
||||
|
Loading…
x
Reference in New Issue
Block a user