mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 22:42:05 +08:00
Ignore touch events on layout only Nodes
Summary: Before this patch, each Node would always generate a node region, representing the bounds of this particular Node. This set of Nodes was used when handling touch to figure out whether we should intercept touch (i.e. a flat Node is catching the draw), or let Android handle touch (i.e. a Node mounted to a View will handle the touch). This patch modifies the list of NodeRegions to exclude any Nodes that draw nothing at all. These Nodes, having no draw output, are effectively layout containers used to group items, so they shouldn't handle touch. Reviewed By: sriramramani Differential Revision: D4369484 fbshipit-source-id: 71b41611873580631f1639f368fa8d971995874f
This commit is contained in:
committed by
Facebook Github Bot
parent
2249af16b7
commit
e380d6d0fd
@@ -261,7 +261,9 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
}
|
||||
|
||||
node.updateNodeRegion(left, top, right, bottom, isVirtual);
|
||||
mNodeRegions.add(node.getNodeRegion());
|
||||
if (node.doesDraw()) {
|
||||
mNodeRegions.add(node.getNodeRegion());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user