react-native/Libraries/Text/TextInput
Mattijs Fuijkschot 8baaacb664 - Keyboard layout now updates when changing keyboardType while it has focus (#19027)
Summary:
This PR makes sure that changing the `keyboardType` props of `<TextInput>` is reflected while the text field has focus. It is something that is also discusses in #13782. The workaround mentioned in that issue using `key` causes the TextInput to re-render itself which has some undesired side-effects.

Fixes #13782

```javascript
export default class KeyboardTypeApp extends Component {
  state = { keyboardType: 'default' };

  toggleKeyboardType = () => {
    this.setState({
      keyboardType: this.state.keyboardType === 'default' ? 'numeric' : 'default'
    });
  }

  render() {
    return (
      <View style={{ padding: 40 }}>
        <TextInput autoFocus value="Press Toggle :)" keyboardType={this.state.keyboardType} />
        <Button title="Toggle" onPress={this.toggleKeyboardType} />
      </View>
    );
  }
}
```

![video](https://user-images.githubusercontent.com/706368/39268429-3e331440-48d0-11e8-947c-7d334e3cec50.gif)

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

 [IOS] [ENHANCEMENT] [TextInput] - Keyboard layout now updates when changing `keyboardType` while it has focus

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19027

Differential Revision: D8416007

Pulled By: PeteTheHeat

fbshipit-source-id: c4f89ab3dc0819bca52feddbc9c7a9f62fd96794
2018-06-13 22:47:47 -07:00
..
Multiline Add option to hide context menu for TextInput #17335 2018-02-27 17:32:24 -08:00
Singleline Add option to hide context menu for TextInput #17335 2018-02-27 17:32:24 -08:00
RCTBackedTextInputDelegate.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBackedTextInputDelegateAdapter.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBackedTextInputDelegateAdapter.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBackedTextInputViewProtocol.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBaseTextInputShadowView.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBaseTextInputShadowView.m Wrong height when TextInput has an empty string 2018-03-19 02:46:34 -07:00
RCTBaseTextInputView.h - Keyboard layout now updates when changing keyboardType while it has focus (#19027) 2018-06-13 22:47:47 -07:00
RCTBaseTextInputView.m - Keyboard layout now updates when changing keyboardType while it has focus (#19027) 2018-06-13 22:47:47 -07:00
RCTBaseTextInputViewManager.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBaseTextInputViewManager.m - Keyboard layout now updates when changing keyboardType while it has focus (#19027) 2018-06-13 22:47:47 -07:00
RCTInputAccessoryShadowView.h iOS OSS: fixed RNTester - missing RCTInputAccessoryShadowView.* in .xcodeproj 2018-03-17 22:01:15 -07:00
RCTInputAccessoryShadowView.m iOS OSS: fixed RNTester - missing RCTInputAccessoryShadowView.* in .xcodeproj 2018-03-17 22:01:15 -07:00
RCTInputAccessoryView.h Refactor RCTInputAccessoryView view hierarchy and names 2018-03-13 11:25:12 -07:00
RCTInputAccessoryView.m Refactor RCTInputAccessoryView view hierarchy and names 2018-03-13 11:25:12 -07:00
RCTInputAccessoryViewContent.h Refactor RCTInputAccessoryView view hierarchy and names 2018-03-13 11:25:12 -07:00
RCTInputAccessoryViewContent.m Fix bug with <InputAccessoryView> safe area conformance 2018-04-04 16:47:16 -07:00
RCTInputAccessoryViewManager.h Support Input Accessory View (iOS Only) [1/N] 2018-02-27 11:09:30 -08:00
RCTInputAccessoryViewManager.m Replace js Dimensions with shadow view in InputAccessoryViewExample 2018-03-15 10:14:15 -07:00
RCTTextSelection.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTTextSelection.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00