react-native/Libraries
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
..
ART Mark `-[init]` w RCT_NOT_IMPLEMENTED 2015-11-14 06:29:27 -08:00
ActionSheetIOS ActionSheetIOS sharing exclude activity types 2015-11-30 06:20:30 -08:00
AdSupport Text highlighting on iOS 2015-07-24 08:41:58 -08:00
Animated Fixed Typo 2015-11-18 08:10:30 -08:00
AppRegistry [React Native] Provide a way to get a list of registered apps in AppRegistry 2015-08-07 11:05:25 -08:00
AppStateIOS revert D2372548 to fix initial app state issue 2015-09-25 13:25:26 -07:00
BatchedBridge Adding jest tests to groups rn 2015-08-31 17:35:47 -08:00
CameraRoll RCTImagePickerManager crash on image from CameraRoll 2015-12-01 02:13:28 -08:00
Components Fix for long press state transition error in Touchable.js 2015-12-02 09:54:29 -08:00
CustomComponents 8/n Fix warnings at startup 2015-12-01 22:53:30 -08:00
DebugComponentHierarchy [ReactNative] Send debug component ownership info in createView 2015-06-25 05:47:24 -08:00
Device flowify some Libraries 2015-03-25 11:09:54 -08:00
Devtools Use pre-bundled elements inspector 2015-10-29 11:21:32 -07:00
Fetch Add fetch's clone function to Request and Response prototypes 2015-10-30 10:57:33 -07:00
Geolocation Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
Image Add onLoadX support on Android 2015-11-25 18:30:31 -08:00
Inspector [react-native] enable react devtools from JavascriptCore 2015-07-23 17:14:09 -08:00
Interaction Make InteractionManager.runAfterInteractions() return a Promise 2015-11-09 20:14:26 -08:00
JavaScriptAppEngine fix several lint warnings 2015-12-01 07:26:29 -08:00
LayoutAnimation Wrapped UIManager native module for better abstraction 2015-11-27 07:00:32 -08:00
LinkingIOS fix several lint warnings 2015-12-01 07:26:29 -08:00
Modal Make <Modal> visible by default 2015-10-30 17:09:27 -07:00
NativeApp [ReactNative] Add "RCTNativeAppEventEmitter" 2015-05-15 16:57:18 -08:00
Network Fixed threading bug in RCTNetworking 2015-12-02 02:24:27 -08:00
Picker fix several lint warnings 2015-12-01 07:26:29 -08:00
Portal Wrapped UIManager native module for better abstraction 2015-11-27 07:00:32 -08:00
PullToRefresh Open source SwipeRefreshLayoutAndroid 2015-11-24 10:15:14 -08:00
PushNotificationIOS Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
QuickPerformanceLogger added QPL for main interactions 2015-09-29 22:25:23 -07:00
RCTTest fix several lint warnings 2015-12-01 07:26:29 -08:00
RKBackendNode Wrapped UIManager native module for better abstraction 2015-11-27 07:00:32 -08:00
ReactIOS Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
ReactNative fix Library/ReactNative lint warnings 2015-11-30 16:25:46 -08:00
Sample Remove invariant of Sample.ios.js that is not used 2015-05-26 18:25:00 -07:00
Settings Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
Storage Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
StyleSheet enable the minWidth/maxWidth/minHeight/maxHeight features 2015-11-17 10:58:32 -08:00
Text Added blurOnSubmit support to multine TextInput (aka RCTTextView) 2015-12-02 08:16:27 -08:00
Utilities Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
Vibration Text highlighting on iOS 2015-07-24 08:41:58 -08:00
WebSocket Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
react-native Wrapped UIManager native module for better abstraction 2015-11-27 07:00:32 -08:00
vendor Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
Promise.js Replace ES6Promise with Promise 2015-04-15 06:06:29 -08:00