[madman] Supports `onLayout` for `AdsManagerTouchableHighlight`.
Summary: Supports `onLayout` for Touchable*` by piping onLayout through to the native component inside since only native components support it by default.
This commit is contained in:
Родитель
bc64f26a7a
Коммит
36dfd402b2
|
@ -211,6 +211,7 @@ var TouchableHighlight = React.createClass({
|
||||||
accessible={true}
|
accessible={true}
|
||||||
ref={UNDERLAY_REF}
|
ref={UNDERLAY_REF}
|
||||||
style={this.state.underlayStyle}
|
style={this.state.underlayStyle}
|
||||||
|
onLayout={this.props.onLayout}
|
||||||
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
|
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
|
||||||
onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
|
onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
|
||||||
onResponderGrant={this.touchableHandleResponderGrant}
|
onResponderGrant={this.touchableHandleResponderGrant}
|
||||||
|
|
|
@ -155,6 +155,7 @@ var TouchableOpacity = React.createClass({
|
||||||
accessible={true}
|
accessible={true}
|
||||||
style={[this.props.style, {opacity: this.state.anim}]}
|
style={[this.props.style, {opacity: this.state.anim}]}
|
||||||
testID={this.props.testID}
|
testID={this.props.testID}
|
||||||
|
onLayout={this.props.onLayout}
|
||||||
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
|
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
|
||||||
onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
|
onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
|
||||||
onResponderGrant={this.touchableHandleResponderGrant}
|
onResponderGrant={this.touchableHandleResponderGrant}
|
||||||
|
|
|
@ -44,7 +44,15 @@ var TouchableWithoutFeedback = React.createClass({
|
||||||
onPress: React.PropTypes.func,
|
onPress: React.PropTypes.func,
|
||||||
onPressIn: React.PropTypes.func,
|
onPressIn: React.PropTypes.func,
|
||||||
onPressOut: 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,
|
onLongPress: React.PropTypes.func,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delay in ms, from the start of the touch, before onPressIn is called.
|
* 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), {
|
return (React: any).cloneElement(onlyChild(this.props.children), {
|
||||||
accessible: this.props.accessible !== false,
|
accessible: this.props.accessible !== false,
|
||||||
testID: this.props.testID,
|
testID: this.props.testID,
|
||||||
|
onLayout: this.props.onLayout,
|
||||||
onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
|
onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
|
||||||
onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,
|
onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,
|
||||||
onResponderGrant: this.touchableHandleResponderGrant,
|
onResponderGrant: this.touchableHandleResponderGrant,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче