react-native/Libraries/Text
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
..
BaseText iOS textTransform style support 2018-04-16 09:01:38 -07:00
RCTText.xcodeproj iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
RawText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Text Fixed problem in Text measurent on iOS 2018-02-25 09:37:38 -08:00
TextInput - Keyboard layout now updates when changing keyboardType while it has focus (#19027) 2018-06-13 22:47:47 -07:00
VirtualText Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTConvert+Text.h iOS: fix up RNTesterPods 2018-05-16 14:14:41 -07:00
RCTConvert+Text.m iOS textTransform style support 2018-04-16 09:01:38 -07:00
RCTTextAttributes.h iOS: fix up RNTesterPods 2018-05-16 14:14:41 -07:00
RCTTextAttributes.m iOS textTransform style support 2018-04-16 09:01:38 -07:00
RCTTextTransform.h iOS textTransform style support 2018-04-16 09:01:38 -07:00
Text.js fix forwardRef displayName on Text and View 2018-06-11 19:22:51 -07:00
TextAncestor.js RN: Replace `context.isInAParentText` w/ React.createContext 2018-05-09 01:16:11 -07:00
TextPropTypes.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
TextProps.js RN: Delete `mergeFast` from `Text` 2018-05-09 01:16:11 -07:00
TextStylePropTypes.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00