Skip to content
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

Map TextInput textContentType strings to Objective-C constants #22611

Conversation

levibuzolic
Copy link
Contributor

@levibuzolic levibuzolic commented Dec 12, 2018

This is an updated version of #22579 which uses compile conditionals to prevent use of undeclared identifier errors when compiling on older versions of Xcode.


Summary

Currently the only textContentType values that work are: username, password, location, name and nickname. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.

Test Plan

Added a Text Content Type example to the RNTester app which shows two examples which weren't previously working.

Note: In my testing, most (if not all) textContentType values don't work on the simulator, instead they need to be tested on a real device.

Before After

Changelog

[iOS] [Fixed] - Fixes textContentTypes not working by mapping textContentType strings to Objective-C constants - Fixes #22578

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Tests This PR adds or edits a test case. labels Dec 12, 2018
@levibuzolic
Copy link
Contributor Author

Thanks for the build output logs @TheSavior -- I've updated the code and tested on an older versions of Xcode so this should work now.

@shergin would I be able to get a quick re-review?

@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch 4 times, most recently from f174de3 to bd78d35 Compare December 13, 2018 03:36
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch 2 times, most recently from 4118d50 to 303aa76 Compare December 19, 2018 23:16
@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch from 303aa76 to 0ed4ece Compare January 7, 2019 01:33
@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch from 0ed4ece to 58b0f91 Compare January 14, 2019 23:24
@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch from 58b0f91 to ce41dd1 Compare January 29, 2019 05:21
@levibuzolic
Copy link
Contributor Author

Label should be updated to Component: TextInput

@mcgaryes
Copy link

mcgaryes commented Feb 2, 2019

@levibuzolic - Any word on what version this PR might make it into?

@levibuzolic
Copy link
Contributor Author

@mcgaryes unfortunately not. It’s with the RN team now. It’s ready to merge but has been sitting here for a while without any attention. 🤷‍♂️

@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch from ce41dd1 to 8adacab Compare February 13, 2019 00:27
@levibuzolic levibuzolic changed the title Map textContentType strings to Objective-C constants Map TextInput textContentType strings to Objective-C constants Feb 13, 2019
@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch from 8adacab to 2f4f2d4 Compare February 13, 2019 00:33
@levibuzolic levibuzolic force-pushed the map-textcontenttype-to-constants-compile-fix branch from 2f4f2d4 to 6223c73 Compare February 13, 2019 02:23
@levibuzolic
Copy link
Contributor Author

@shergin anything I can do to get this across the line for a future release? Should be good to go as far as I can tell.

@levibuzolic
Copy link
Contributor Author

@kelset sorry to ping you here, but I'm really keen to try and get this in to the next release, any chance I could get a review/merge from the team?

@kelset
Copy link
Contributor

kelset commented Feb 19, 2019

Hey thanks for the ping - I'll see if we can merge it but no promises 😛

Copy link
Contributor

@shergin shergin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's land this.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Feb 20, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@levibuzolic merged commit a89fe41 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 20, 2019
@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 20, 2019
mbardauskas pushed a commit to mbardauskas/react-native that referenced this pull request Feb 21, 2019
…ook#22611)

Summary:
This is an updated version of facebook#22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue facebook#22578 has more detail examples/explanation.
Pull Request resolved: facebook#22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 23, 2019
grabbou pushed a commit that referenced this pull request Feb 27, 2019
Summary:
This is an updated version of #22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: #22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
grabbou pushed a commit that referenced this pull request Feb 28, 2019
Summary:
This is an updated version of #22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: #22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
@levibuzolic levibuzolic deleted the map-textcontenttype-to-constants-compile-fix branch February 28, 2019 23:05
buoyad pushed a commit to keybase/react-native that referenced this pull request Apr 22, 2019
…ook#22611)

Summary:
This is an updated version of facebook#22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue facebook#22578 has more detail examples/explanation.
Pull Request resolved: facebook#22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
…ook#22611)

Summary:
This is an updated version of facebook#22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue facebook#22578 has more detail examples/explanation.
Pull Request resolved: facebook#22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Component: Text Merged This PR has been merged. Platform: iOS iOS applications. Tests This PR adds or edits a test case.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Most TextInput textContentTypes don't work due to mismatched string constants
9 participants