From 4aed47d53bbbc0abb3f65c2b65da632cffc7b80d Mon Sep 17 00:00:00 2001 From: Julien K Date: Thu, 10 Aug 2017 22:31:40 +0200 Subject: [PATCH] [tvOS] Change behavior of onPress --- Libraries/Components/Touchable/TouchableHighlight.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 19e6012474ef09..178511eb5653f0 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -14,6 +14,7 @@ const ColorPropType = require('ColorPropType'); const NativeMethodsMixin = require('NativeMethodsMixin'); const PropTypes = require('prop-types'); +const Platform = require('Platform'); const React = require('React'); const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); const StyleSheet = require('StyleSheet'); @@ -190,9 +191,10 @@ var TouchableHighlight = createReactClass({ touchableHandlePress: function(e: Event) { this.clearTimeout(this._hideTimeout); - this._showUnderlay(); - this._hideTimeout = this.setTimeout(this._hideUnderlay, - this.props.delayPressOut || 100); + if (!Platform.isTVOS) { + this._showUnderlay(); + this._hideTimeout = this.setTimeout(this._hideUnderlay, this.props.delayPressOut || 100); + } this.props.onPress && this.props.onPress(e); },