react-native/Libraries/Components/Touchable
Nick Lockwood 7ab17e5ef3 Fix for long press state transition error in Touchable.js
Summary:
public

This diff fixes an occasional JS exception thrown by Touchable.js when it attempts to transitions to the RESPONDER_ACTIVE_LONG_PRESS_IN state from the RESPONDER_INACTIVE_PRESS_IN state.

Although I wasn't able to reproduce the error while testing, I was able to identify the likely cause: the LONG_PRESS_DETECTED state transition is triggered by a timer that is started on touch-down. This timer should be cancelled if the gesture is interrupted, however I identified a code path where the state can be changed to RESPONDER_INACTIVE_PRESS_IN without the longPressDelayTimeout being cancelled.

To fix this, I've added some logic to cancel the timer in that case. I've also added a test for the error scenario that will display a redbox in __DEV__ mode, but will fail gracefully in production mode.

Reviewed By: jingc

Differential Revision: D2709750

fb-gh-sync-id: aeea1a31de5e92eb394c2ea177f556b131d50790
2015-12-02 09:54:29 -08:00
..
BoundingDimensions.js fix Libraries/Components/Touchable lint warnings 2015-11-30 17:16:26 -08:00
Position.js fix Libraries/Components/Touchable lint warnings 2015-11-30 17:16:26 -08:00
Touchable.js Fix for long press state transition error in Touchable.js 2015-12-02 09:54:29 -08:00
TouchableBounce.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
TouchableHighlight.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
TouchableNativeFeedback.android.js Wrapped UIManager native module for better abstraction 2015-11-27 07:00:32 -08:00
TouchableNativeFeedback.ios.js [ReactNative] Add TouchableNativeFeedback to OSS 2015-08-26 01:31:52 -08:00
TouchableOpacity.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
TouchableWithoutFeedback.js Expose the touch-retention offset as a prop 2015-11-16 13:53:31 -08:00
ensureComponentIsNative.js flowified Libraries from Avik 2015-03-25 12:44:28 -08:00
ensurePositiveDelayProps.js [Touchable] Add custom delay props to Touchable components 2015-06-03 12:57:28 -08:00