react-native/Libraries
Adam Comella 26aa27da63 Fix TextInput autocorrect (#7496)
Summary:
Autocorrect was broken for controlled TextInput components by a change to batch event handling in React Native:
9f11f8c263

For example, a TextInput like this would be affected by this bug:

```javascript
<TextInput
  autoCorrect={true}
  style={{height: 26, width: 100}}
  onChangeText={(text) => this.setState({ text })}
  value={this.state.text}
/>
```
This fix uses the same approach as
0cd2904b23

The problem is that TextInput's _onChange handler relied on this.props.value being updated synchronously when calling this.props.onChangeText(text). However, this assumption was broken when React Native event handling started being batched.

The fix is to move the code that relies on this.props.value being up-to-date to componentDidUpdate.

**Test plan (required)**

Tested autocorrect now works on iOS in a small app and a large app. Also tested t
Closes https://github.com/facebook/react-native/pull/7676

Differential Revision: D3346221

Pulled By: nicklockwood

fbshipit-source-id: 715df3e8a03aa58cb0a462de4add02289d42782f
2016-05-26 07:28:18 -07:00
..
ART Check if either array is null before diffing 2016-04-25 13:28:31 -07:00
ActionSheetIOS ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
AdSupport Text highlighting on iOS 2015-07-24 08:41:58 -08:00
Animated Round alpha channel when interpolating colors to the nearest thousandth. 2016-05-17 10:13:29 -07:00
AppRegistry Refactor BugReporing to avoid multiple registers 2016-05-18 14:28:26 -07:00
AppState Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
BatchedBridge Memoize lazy module configs 2016-05-16 03:58:23 -07:00
BugReporting Make BugReporting not pull in native module on require 2016-05-19 12:58:21 -07:00
CameraRoll ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
Components Fix TextInput autocorrect (#7496) 2016-05-26 07:28:18 -07:00
CustomComponents explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
DebugComponentHierarchy Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
Devtools Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
EventEmitter Add a removeListener method to DeviceEventEmitter for Framework consi… 2016-05-24 11:45:51 -07:00
Experimental explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
Fetch Reject promise if network request failed 2016-03-08 16:37:24 -08:00
Geolocation Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system 2016-05-25 04:28:36 -07:00
Image Fixed image test flakiness by tying decoded image cache to module lifecycle 2016-05-25 06:58:23 -07:00
Inspector Fix internal fields access for inspector 2016-05-20 12:13:48 -07:00
Interaction explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
JavaScriptAppEngine Set up Systrace during initialization 2016-05-24 12:13:24 -07:00
LayoutAnimation Add support for delete animation in LayoutAnimation on iOS 2016-04-25 00:19:25 -07:00
Linking Mention native code in `Linking` docs 2016-04-20 19:23:19 -07:00
LinkingIOS Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system 2016-05-25 04:28:36 -07:00
Modal explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
NavigationExperimental Fix NavigationTransitioner. 2016-05-25 11:28:21 -07:00
Network Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system 2016-05-25 04:28:36 -07:00
PushNotificationIOS Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system 2016-05-25 04:28:36 -07:00
QuickPerformanceLogger added QPL for main interactions 2015-09-29 22:25:23 -07:00
RCTTest Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RKBackendNode Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
ReactIOS explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
ReactNative Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
Sample Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
Settings Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
Storage change undeclared variable to intended value 2016-05-26 01:43:30 -07:00
StyleSheet Deprecate transformMatrix and decomposedMatrix 2016-04-29 14:19:25 -07:00
Text Fixed multiline textinput onChange event 2016-05-25 06:13:25 -07:00
Utilities explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
Vibration Add support for vibration patterns 2016-03-29 21:45:20 -07:00
WebSocket Updated Websocket to use new event system 2016-05-12 08:30:24 -07:00
react-native Expose Systrace from the 'react-native' package 2016-05-25 05:28:22 -07:00
vendor Fixed NativeEventListener deregistration 2016-05-16 04:13:56 -07:00
Promise.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
promiseRejectionIsError.js Add possibility to `console.error`/redbox on promise rejections 2016-03-15 05:22:22 -07:00