Fix autoCapitalize bitmask collision with numeric inputType flags#55786
Fix autoCapitalize bitmask collision with numeric inputType flags#55786lukeharvey wants to merge 2 commits intofacebook:mainfrom
Conversation
|
Hi @lukeharvey! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Fix makes sense to me, but I think we would need to re-run this logic if keyboard type changes as well? Maybe we can derive correct final InputType, from the different props |
Summary:
setAutoCapitalizeappliesAUTOCAPITALIZE_FLAGS(0x7000) to all input types, but this mask overlapsTYPE_NUMBER_FLAG_SIGNED(0x1000) andTYPE_NUMBER_FLAG_DECIMAL(0x2000). On every Fabric re-render, this strips the signed/decimal flags from numeric inputs, causingcommitStagedInputTypeto callsetInputType()with corrupted flags, which restarts the IME and breaks composing-based input (e.g. Samsung keyboards' shared./-key).The fix skips
setAutoCapitalizeforTYPE_CLASS_NUMBERinputs, where autocapitalize is meaningless.Changelog:
[Android] [Fixed] - Fix
setAutoCapitalizestripping numericTextInputflags (TYPE_NUMBER_FLAG_SIGNED/DECIMAL), affecting minus sign input on Samsung keyboardsTest Plan:
A unit test was added to
ReactTextInputPropertyTest.ktthat verifiessetAutoCapitalizedoes not stripTYPE_NUMBER_FLAG_SIGNEDorTYPE_NUMBER_FLAG_DECIMALwhen the input type class isTYPE_CLASS_NUMBER.