Backed out changeset 409acf8d3356

Differential Revision: D6789941

fbshipit-source-id: 30d431727a4615208f51293d071f9334584a2269
This commit is contained in:
Eli White 2018-01-23 19:00:31 -08:00 committed by Facebook Github Bot
parent 42c410ac84
commit cd263a2cc7

View File

@ -12,7 +12,6 @@
'use strict';
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const React = require('React');
const PropTypes = require('prop-types');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
@ -46,7 +45,7 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
*/
const TouchableWithoutFeedback = createReactClass({
displayName: 'TouchableWithoutFeedback',
mixins: [NativeMethodsMixin, TimerMixin, Touchable.Mixin],
mixins: [TimerMixin, Touchable.Mixin],
propTypes: {
accessible: PropTypes.bool,
@ -160,7 +159,8 @@ const TouchableWithoutFeedback = createReactClass({
},
touchableGetLongPressDelayMS: function(): number {
return this.props.delayLongPress != null ? this.props.delayLongPress : 500;
return this.props.delayLongPress === 0 ? 0 :
this.props.delayLongPress || 500;
},
touchableGetPressOutDelayMS: function(): number {
@ -184,8 +184,7 @@ const TouchableWithoutFeedback = createReactClass({
const style = (Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text') ?
[child.props.style, {color: 'red'}] :
child.props.style;
return React.cloneElement(child, {
return (React: any).cloneElement(child, {
accessible: this.props.accessible !== false,
accessibilityLabel: this.props.accessibilityLabel,
accessibilityComponentType: this.props.accessibilityComponentType,
@ -194,7 +193,6 @@ const TouchableWithoutFeedback = createReactClass({
testID: this.props.testID,
onLayout: this.props.onLayout,
hitSlop: this.props.hitSlop,
...child.props,
onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,
onResponderGrant: this.touchableHandleResponderGrant,