mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 09:21:44 +08:00
Summary: When you have a numeric non-multiline `TextInput` and a `returnKeyType` is `done` we automatically add an input accessory view ([implementation](603cc48ceb/Libraries/Text/RCTTextInput.m (L269)#L315)). That view has a done button which triggers [handleInputAccessoryDoneButton](603cc48ceb/Libraries/Text/RCTTextInput.m (L317...L320)) which currently directly sends `endEditing:` to the text field / text view. As a consequence, the [textInputShouldReturn](603cc48ceb/Libraries/Text/RCTTextInput.m (L118...L121)) is not called and we dismiss the keyboard even if the `blurOnSubmit` value is `false`. Confirm that the keyboard is not dismissed when you tap on Done button on this `TextInput`: ``` <TextInput keyboardType={'numeric'} returnKeyType={'done'} blurOnSubmit={false} /> ``` and that the keyboard is dismissed for this `TextInput`: ``` <TextInput keyboardType={'numeric'} returnKeyType={'done'} blurOnSubmit /> ``` Closes https://github.com/facebook/react-native/pull/15438 Differential Revision: D5601462 Pulled By: javache fbshipit-source-id: 24e4048e2e66d1a42fa97d83b4a3eb61e5d817ea