react-native/Libraries/Text
Adam Comella 8016d838be iOS: Fix autoCorrect doesn't revert to initial state
Summary:
There's an inconsistency in autoCorrect's default state:
  - If you don't specify a value for autoCorrect, it defaults to on.
  - If you specify true/false for autoCorrect and later specify null, autoCorrect turns off. It should have reverted to its initial state of on.

The reason for this discrepancy is that autoCorrect is exposed to JS as a boolean but it is actually an enum with three states in native:
  - UITextAutocorrectionTypeDefault (the default value)
  - UITextAutocorrectionTypeYes
  - UITextAutocorrectionTypeNo

This is fixed by explicitly mapping JS null to UITextAutocorrectionTypeDefault.

**Test plan (required)**

Verified that switching `autoCorrect` between `true`, `false`, and `null` all work correctly in single line and multiline `TextInputs`.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/11055

Differential Revision: D4226419

Pulled By: javache

fbshipit-source-id: e3e5769a3aa537f00fb56ca4ae622ff4213481c5
2016-11-23 05:43:35 -08:00
..
RCTText.xcodeproj iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTConvert+Text.h iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTConvert+Text.m iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTRawTextManager.h [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
RCTRawTextManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTShadowRawText.h [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
RCTShadowRawText.m Move dirty layout into css-layout 2016-07-25 03:58:41 -07:00
RCTShadowText.h Added support of `<Text>`'s `selectable` attribute on iOS 2016-11-17 16:13:28 -08:00
RCTShadowText.m Added support of `<Text>`'s `selectable` attribute on iOS 2016-11-17 16:13:28 -08:00
RCTText.h Added support of `<Text>`'s `selectable` attribute on iOS 2016-11-17 16:13:28 -08:00
RCTText.m Added support of `<Text>`'s `selectable` attribute on iOS 2016-11-17 16:13:28 -08:00
RCTTextField.h iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTTextField.m iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTTextFieldManager.h Migrated RCTText into FBReactKit 2015-07-08 07:13:00 -08:00
RCTTextFieldManager.m iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTTextManager.h Add support for multiline TextInput via UITextView 2015-04-29 01:33:58 -08:00
RCTTextManager.m Fix CSSLayout import hack, update podspec 2016-11-21 09:13:36 -08:00
RCTTextSelection.h Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
RCTTextSelection.m Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
RCTTextView.h iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTTextView.m iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
RCTTextViewManager.h Add support for multiline TextInput via UITextView 2015-04-29 01:33:58 -08:00
RCTTextViewManager.m iOS: Fix autoCorrect doesn't revert to initial state 2016-11-23 05:43:35 -08:00
Text.js Added support of `<Text>`'s `selectable` attribute on iOS 2016-11-17 16:13:28 -08:00
TextStylePropTypes.js Remove FlowFixMe from TextStylePropTypes 2016-11-10 08:58:41 -08:00
TextUpdateTest.js RN: Update React (2/2) 2016-11-04 05:43:44 -07:00