Skip to content

[0.71] Web Prop update caused unexpected breaking changes #36229

Description

@Titozzz

Description

Following the work from #34424, there was some (unexpected?) breaking changes to <TextInput />.

Before there were 2 props:

  • autoComplete => android (name-family, name-given, etc)
  • textContentType => iOS (familyName, givenName, etc)

Now due to the changes, there is still 2 props:

  • autoComplete => android & iOS
  • textContentType => iOS

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:

  • android: check if name is in the new set of keys, if so map to the android value, else pass it directly to android (compatibility with old keys)
  • iOS: check if the name is in the set of keys, if so map to the iOS value, else if textContentType is defined, use it.

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 textContentType

Snack, code example, screenshot, or link to a repository

/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions