diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 4c7324d6f..ca9412666 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -189,7 +189,7 @@ var TouchableHighlight = React.createClass({ }, _showUnderlay: function() { - if (!this.isMounted()) { + if (!this.isMounted() || !this._hasPressHandler()) { return; } @@ -201,7 +201,7 @@ var TouchableHighlight = React.createClass({ _hideUnderlay: function() { this.clearTimeout(this._hideTimeout); this._hideTimeout = null; - if (this.refs[UNDERLAY_REF]) { + if (this._hasPressHandler() && this.refs[UNDERLAY_REF]) { this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS); this.refs[UNDERLAY_REF].setNativeProps({ ...INACTIVE_UNDERLAY_PROPS, @@ -211,6 +211,15 @@ var TouchableHighlight = React.createClass({ } }, + _hasPressHandler: function() { + return !!( + this.props.onPress || + this.props.onPressIn || + this.props.onPressOut || + this.props.onLongPress + ); + }, + render: function() { return (