mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix setting keyboardType from breaking autoCapitalize (#27523)
Summary: Fix for https://github.com/facebook/react-native/issues/27510. Setting the `InputType.TYPE_CLASS_TEXT` flag when `keyboardType` is null or default breaks autoCapitalize. Handle the case when `keyboardType` is null, default, or invalid type. ## Changelog [Android] [Fixed] - Fix setting keyboardType from breaking autoCapitalize Pull Request resolved: https://github.com/facebook/react-native/pull/27523 Test Plan: Added keyboardType prop to RNTester as so ``` <TextInput autoCapitalize="words" keyboardType="default" style={styles.default} /> ```  Reviewed By: makovkastar Differential Revision: D19132261 Pulled By: JoshuaGross fbshipit-source-id: be66f0317ed305425ebcff32046ad4bff06d367f
This commit is contained in:
committed by
Eloy Durán
parent
dfa8fed64b
commit
d22cc4f2bd
+4
@@ -731,6 +731,10 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
// This will supercede secureTextEntry={false}. If it doesn't, due to the way
|
||||
// the flags work out, the underlying field will end up a URI-type field.
|
||||
flagsToSet = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
|
||||
} else {
|
||||
// This prevents KEYBOARD_TYPE_FLAGS from being set when the keyboardType is
|
||||
// default, unsupported or null. Setting of this flag breaks the autoCapitalize functionality.
|
||||
return;
|
||||
}
|
||||
updateStagedInputTypeFlag(view, KEYBOARD_TYPE_FLAGS, flagsToSet);
|
||||
checkPasswordType(view);
|
||||
|
||||
Reference in New Issue
Block a user