diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 4b6442ed48..27ddcdd4ed 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -211,6 +211,7 @@ var TouchableHighlight = React.createClass({ accessible={true} ref={UNDERLAY_REF} style={this.state.underlayStyle} + onLayout={this.props.onLayout} onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest} onResponderGrant={this.touchableHandleResponderGrant} diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 3d9780d8a6..b5203cfc76 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -155,6 +155,7 @@ var TouchableOpacity = React.createClass({ accessible={true} style={[this.props.style, {opacity: this.state.anim}]} testID={this.props.testID} + onLayout={this.props.onLayout} onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest} onResponderGrant={this.touchableHandleResponderGrant} diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index d8b1711829..a4921052e4 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -44,7 +44,15 @@ var TouchableWithoutFeedback = React.createClass({ onPress: React.PropTypes.func, onPressIn: React.PropTypes.func, onPressOut: React.PropTypes.func, + /** + * Invoked on mount and layout changes with + * + * `{nativeEvent: {layout: {x, y, width, height}}}` + */ + onLayout: React.PropTypes.func, + onLongPress: React.PropTypes.func, + /** * Delay in ms, from the start of the touch, before onPressIn is called. */ @@ -113,6 +121,7 @@ var TouchableWithoutFeedback = React.createClass({ return (React: any).cloneElement(onlyChild(this.props.children), { accessible: this.props.accessible !== false, testID: this.props.testID, + onLayout: this.props.onLayout, onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest, onResponderGrant: this.touchableHandleResponderGrant,