From 98309fa7fce9e7d72416c76a25dc0f759f46c3e8 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 21 May 2020 14:02:40 -0700 Subject: [PATCH] Touchable: Revert `minPressDuration` on Legacy Components Summary: When `minPressDuration` was introduced to `Pressability`, all of the legacy Touchable components inherited the new default. This restore the former behavior for these legacy components so that only `Pressable` gets the new `minPressDuration` default value. Changelog: [General][Fixed] - Revert `minPressDuration` effect on legacy Touchable components Reviewed By: fkgozali Differential Revision: D21682764 fbshipit-source-id: b71a61843fae7f0f726155876a064fabd3ba1c64 --- Libraries/Components/Touchable/TouchableBounce.js | 1 + Libraries/Components/Touchable/TouchableHighlight.js | 1 + Libraries/Components/Touchable/TouchableNativeFeedback.js | 1 + Libraries/Components/Touchable/TouchableOpacity.js | 1 + Libraries/Components/Touchable/TouchableWithoutFeedback.js | 1 + 5 files changed, 5 insertions(+) diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index c47129dd392..1856034e927 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -53,6 +53,7 @@ class TouchableBounce extends React.Component { delayLongPress: this.props.delayLongPress, delayPressIn: this.props.delayPressIn, delayPressOut: this.props.delayPressOut, + minPressDuration: 0, pressRectOffset: this.props.pressRetentionOffset, android_disableSound: this.props.touchSoundDisabled, onBlur: event => { diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index c7db381c792..13c0ccee82e 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -174,6 +174,7 @@ class TouchableHighlight extends React.Component { delayLongPress: this.props.delayLongPress, delayPressIn: this.props.delayPressIn, delayPressOut: this.props.delayPressOut, + minPressDuration: 0, pressRectOffset: this.props.pressRetentionOffset, android_disableSound: this.props.touchSoundDisabled, onBlur: event => { diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.js b/Libraries/Components/Touchable/TouchableNativeFeedback.js index ed03379c54d..5dc03df8770 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.js @@ -178,6 +178,7 @@ class TouchableNativeFeedback extends React.Component { delayLongPress: this.props.delayLongPress, delayPressIn: this.props.delayPressIn, delayPressOut: this.props.delayPressOut, + minPressDuration: 0, pressRectOffset: this.props.pressRetentionOffset, android_disableSound: this.props.touchSoundDisabled, onLongPress: this.props.onLongPress, diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index aa5239fddaf..106efccf4e2 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -147,6 +147,7 @@ class TouchableOpacity extends React.Component { delayLongPress: this.props.delayLongPress, delayPressIn: this.props.delayPressIn, delayPressOut: this.props.delayPressOut, + minPressDuration: 0, pressRectOffset: this.props.pressRetentionOffset, onBlur: event => { if (Platform.isTV) { diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 5ad8aa62e5f..0cb20d0dbad 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -179,6 +179,7 @@ function createPressabilityConfig(props: Props): PressabilityConfig { delayLongPress: props.delayLongPress, delayPressIn: props.delayPressIn, delayPressOut: props.delayPressOut, + minPressDuration: 0, pressRectOffset: props.pressRetentionOffset, android_disableSound: props.touchSoundDisabled, onBlur: props.onBlur,