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 positionOnActivate = this.state.touchable.positionOnActivate;
|
||||||
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
|
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
|
||||||
var pressRectOffset = this.touchableGetPressRectOffset ?
|
var pressRectOffset = this.touchableGetPressRectOffset ?
|
||||||
this.touchableGetPressRectOffset() : null;
|
this.touchableGetPressRectOffset() : {
|
||||||
var pressExpandLeft =
|
left: PRESS_EXPAND_PX,
|
||||||
pressRectOffset.left != null ? pressRectOffset.left : PRESS_EXPAND_PX;
|
right: PRESS_EXPAND_PX,
|
||||||
var pressExpandTop =
|
top: PRESS_EXPAND_PX,
|
||||||
pressRectOffset.top != null ? pressRectOffset.top : PRESS_EXPAND_PX;
|
bottom: PRESS_EXPAND_PX
|
||||||
var pressExpandRight =
|
};
|
||||||
pressRectOffset.right != null ? pressRectOffset.right : PRESS_EXPAND_PX;
|
|
||||||
var pressExpandBottom =
|
var pressExpandLeft = pressRectOffset.left;
|
||||||
pressRectOffset.bottom != null ? pressRectOffset.bottom : PRESS_EXPAND_PX;
|
var pressExpandTop = pressRectOffset.top;
|
||||||
|
var pressExpandRight = pressRectOffset.right;
|
||||||
|
var pressExpandBottom = pressRectOffset.bottom;
|
||||||
|
|
||||||
var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
||||||
var pageX = touch && touch.pageX;
|
var pageX = touch && touch.pageX;
|
||||||
var pageY = touch && touch.pageY;
|
var pageY = touch && touch.pageY;
|
||||||
|
|
Loading…
Reference in New Issue