mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Fixes a path in touchableHandlerResponderGrant method when touchableGetPressRectOffset method is not present.
Summary: Current code is checking presence of touchableGetPressRectOffset method but fails immediately on trying to get 'left' value of null. Closes https://github.com/facebook/react-native/pull/3438 Reviewed By: @svcscm Differential Revision: D2545068 Pulled By: @javache fb-gh-sync-id: d16cb46af1fc6eae02f56b2096c2169ce475e022
This commit is contained in:
parent
4ec5161685
commit
d0e40c581d
@ -420,16 +420,18 @@ var TouchableMixin = {
|
||||
var positionOnActivate = this.state.touchable.positionOnActivate;
|
||||
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
|
||||
var pressRectOffset = this.touchableGetPressRectOffset ?
|
||||
this.touchableGetPressRectOffset() : null;
|
||||
var pressExpandLeft =
|
||||
pressRectOffset.left != null ? pressRectOffset.left : PRESS_EXPAND_PX;
|
||||
var pressExpandTop =
|
||||
pressRectOffset.top != null ? pressRectOffset.top : PRESS_EXPAND_PX;
|
||||
var pressExpandRight =
|
||||
pressRectOffset.right != null ? pressRectOffset.right : PRESS_EXPAND_PX;
|
||||
var pressExpandBottom =
|
||||
pressRectOffset.bottom != null ? pressRectOffset.bottom : PRESS_EXPAND_PX;
|
||||
|
||||
this.touchableGetPressRectOffset() : {
|
||||
left: PRESS_EXPAND_PX,
|
||||
right: PRESS_EXPAND_PX,
|
||||
top: PRESS_EXPAND_PX,
|
||||
bottom: PRESS_EXPAND_PX
|
||||
};
|
||||
|
||||
var pressExpandLeft = pressRectOffset.left;
|
||||
var pressExpandTop = pressRectOffset.top;
|
||||
var pressExpandRight = pressRectOffset.right;
|
||||
var pressExpandBottom = pressRectOffset.bottom;
|
||||
|
||||
var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
||||
var pageX = touch && touch.pageX;
|
||||
var pageY = touch && touch.pageY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user