This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix android TextInput transitions
Summary: On Android, when changing the props on TextInput component, there are cases where behavior is incorrect. ex: there were two other PR requests to fix the following issues: 1) TextInput doesnt respect the autoCapitalize prop when keyboardType is set to "default" 2) Password visibility is broken But those PRs ended up breaking a transition from phone-pad to default Root cause - The issue is that the bits that Android defines to store the InputType flags are reused. - For example, the previous issue: TYPE_TEXT_FLAG_CAP_WORDS and TYPE_NUMBER_FLAG_DECIMAL are both using 0x00002000 bit. So when switching input types from phone-pad to default (text), it is not known if this bit should be cleared. It could have been set for capitalize or for indicating the num pad should be generic. the solution is to always unset the TYPE_CLASS flags before setting the keyboardType so the user has the correct keyboard. Changelog: [Fixed] TextInput transition from phone-pad to default Reviewed By: JoshuaGross Differential Revision: D20263334 fbshipit-source-id: 0b283fbd6314bf10b90f760917447d2439aaa147
- Loading branch information
Showing 1 changed file with 1 addition and 14 deletions.