-
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
[0.71] Web Prop update caused unexpected breaking changes #36229
Comments
cc: @necolas |
If you use autoComplete = "A" it should be mapped to whatever the corresponding value of textContentType should be, which isn't necessarily "A". Hard to say anything more without a concrete example of the issue you're experiencing |
If both props were here before, and we repurposed one of them without documenting it as a breaking change, I think we messed up here. I.e. the web prop precedence should only come into effect for someone using a newly introduced prop. |
It seems like this change effectively breaks any previous xplat usage of the prop, so we should patch this imo, and make the break later if we want to make it. |
We added values to |
It seems like this is the scenario:
So, if Android and iOS disagreed before. Which is, more scoped, but still technically breaking. |
Yes but |
An example with cc-number, if we have an input that can take credit card information or bank account numbers. There you have a regression that was unexpected! |
While I understand this is niche and easily fixable dev side, I'm wondering why this approach was chosen, since the non-breaking alternative strategy (using the textContentType first and warn) seemed easier to me (and would also create discovery for the new capabilities) |
When do you need to input letters for a credit card number?
It's consistent with what we did for dozens of other props and styles. |
Bank account have letters in them! |
@necolas interesting, can you list all the props we've done this for? I know about the props where the new one takes precedence over the old prop (only impacts new code), but I didn't follow close enough to see the props where we added support for an existing prop on one platform to both platforms (changing the behavior of existing code). |
Bank account should not use There is an open HTML issue for adding an autocomplete type for bank accounts, but in the meantime you are expected to use free text entry. On web you can also pattern match to limit to numbers and letters, but React Native doesn't have support for declarative patterns. |
@necolas I know, but it was a shared input for two data types, that's probably a bad idea but that's what is was. And so have autocomplete for half the data was better than nothing I guess. 🙄 Once again this is just a silly example revealing something that happened. I don't really want to slow down the effort to migrate to universal props nor argue about the pertinence of old code from our codebase. The only goal was to show some this was a breaking behaviour while offering an alternative 😄 |
Hey guys for an update, @rickhanlonii, @necolas and I met up to talk about this and the general strategy going forward. For this case particularly, I am going to:
In our discussion we would like to address this one-off and don't see this as a wide-spread issue (as-in, it likely isn't an issue for other prop aliases we've added). In future efforts around conformance we're going to be more intentional in making block changes behind gating flags so we don't get these paper-cuts for un-intentional adoption. cc @NickGerleman |
Summary: Changelog: [iOS][Changed] - Give precedence to `textContentType` property for backwards compat as mentioned in #36229 (comment) Reviewed By: necolas Differential Revision: D44106291 fbshipit-source-id: 5702d7f171735d1abe6cfbc9ca1ad8f21751d51e
Summary: Changelog: [iOS][Changed] - Give precedence to `textContentType` property for backwards compat as mentioned in #36229 (comment) Reviewed By: necolas Differential Revision: D44106291 fbshipit-source-id: 5702d7f171735d1abe6cfbc9ca1ad8f21751d51e
Thanks |
Summary: Changelog: [iOS][Changed] - Give precedence to `textContentType` property for backwards compat as mentioned in facebook#36229 (comment) Reviewed By: necolas Differential Revision: D44106291 fbshipit-source-id: 5702d7f171735d1abe6cfbc9ca1ad8f21751d51e
Description
Following the work from #34424, there was some (unexpected?) breaking changes to
<TextInput />
.Before there were 2 props:
Now due to the changes, there is still 2 props:
But the new implementation looks like this:
There is a new universal set of keys (some of them identical to the old one, some news)
When you set autoComplete:
What's breaking is that for example if you used autoComplete = "A" and textContentType="B", on 0.71 it will be treated as textContentType="A" on 0.71
How we could have mitigated this:
-> Deprecate and set warnings on textContentType but still use it first in the implementation so that user migrate without breaking their apps
Version
0.71
Output of
npx react-native info
/
Steps to reproduce
Use
TextInput
with autoComplete and textContentTypeSnack, code example, screenshot, or link to a repository
/
The text was updated successfully, but these errors were encountered: