-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextInput autoCapitalize="words" not working when keyboardType prop is passed on Android #27510
Comments
I investigated this issue on master, it works correctly with the physical keyboard; however, not with soft input (inputs from your computer). With soft input notice how the capitalize on the keyboard turns on with every space. This is an issue with the soft input key listener, should be fine in a shipped app. |
@safaiyeh It's not. I've confirmed this issue on Android devices in development and production. It occured on every Android device I tested on. The only workaround was to remove the |
@WouterFlorijn I understand now. Android's So the only time this is true is when there is no prop or Current behavior |
Submitted a PR to fix this bug: #27523 |
Summary: Fix for #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: #27523 Test Plan: Added keyboardType prop to RNTester as so ``` <TextInput autoCapitalize="words" keyboardType="default" style={styles.default} /> ``` ![fixedKeyboardType](https://user-images.githubusercontent.com/8675043/70872892-c96dec80-1f5f-11ea-8e33-714a67eff581.gif) Reviewed By: makovkastar Differential Revision: D19132261 Pulled By: JoshuaGross fbshipit-source-id: be66f0317ed305425ebcff32046ad4bff06d367f
This can be closed as the fix was merged in. cc @TheSavior |
Summary: Fix for #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: #27523 Test Plan: Added keyboardType prop to RNTester as so ``` <TextInput autoCapitalize="words" keyboardType="default" style={styles.default} /> ``` ![fixedKeyboardType](https://user-images.githubusercontent.com/8675043/70872892-c96dec80-1f5f-11ea-8e33-714a67eff581.gif) Reviewed By: makovkastar Differential Revision: D19132261 Pulled By: JoshuaGross fbshipit-source-id: be66f0317ed305425ebcff32046ad4bff06d367f
Summary: Fix for facebook#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: facebook#27523 Test Plan: Added keyboardType prop to RNTester as so ``` <TextInput autoCapitalize="words" keyboardType="default" style={styles.default} /> ``` ![fixedKeyboardType](https://user-images.githubusercontent.com/8675043/70872892-c96dec80-1f5f-11ea-8e33-714a67eff581.gif) Reviewed By: makovkastar Differential Revision: D19132261 Pulled By: JoshuaGross fbshipit-source-id: be66f0317ed305425ebcff32046ad4bff06d367f
Ao invés de usar AutoCapitalize="Words" ex..: text.charAt(0).toUpperCase() + text.slice(1) Essa parte do codigo faz com que toda entrada no textinput seja com a primeira letra maiúscula e o restante minuscula. Espero poder ter ajudado! |
I keep having the problem |
I've figured out that
|
autoCapitalize still doesn't work even after removing multiline & keyboardType props. Any update on this? |
@KPS250 any update have you resolved ? |
any updates on this? Autocap still doesn't work on Android |
When adding
autoCapitalize="words"
andkeyboardType
with any value, on Android, nothing is auto-capitalized. There have been other issues regarding this, but they have been closed, locked and since ignored (#11776 #8932).In older issues/comments it's stated that this happens only when margin or padding is applied through style on the
TextInput
, but this is not the case. It also happens without.If this has been fixed in React Native 0.60+, please let me know. I'm only able to test on 0.59.
React Native version:
info
React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 4.79 GB / 15.89 GB
Binaries:
Yarn: 1.1.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.10.3 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
Steps To Reproduce
autoCapitalize="words"
to aTextInput
.keyboardType=...
with any value. Evenundefined
, even thoughundefined
props are supposed to be ignored in React.Describe what you expected to happen:
The first letter of each word is capitalized.
The text was updated successfully, but these errors were encountered: