-
Notifications
You must be signed in to change notification settings - Fork 25k
feat(iOS): add all supported ReturnKeyTypes #43362
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
Conversation
Base commit: c13790f |
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @elencho, thanks for the contribution! I'll import it and see how it behaves internally!
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for getting back to this after the approval.
A colleague was doing a second pass and he raised some relevant concerns.
I left a couple of suggestions in the code.
Plus, this is a file for the old architecture only. It is great that you fixed this, but could you apply the same changes to this other file, for the New Architecture?
Thank you so much! 🙏
| NSArray<NSNumber *> *returnKeyTypes = @[ | ||
| @(UIReturnKeyDone), | ||
| @(UIReturnKeyGo), | ||
| @(UIReturnKeyDefault), | ||
| @(UIReturnKeyNext), | ||
| @(UIReturnKeySearch), | ||
| @(UIReturnKeySend), | ||
| @(UIReturnKeyYahoo), | ||
| @(UIReturnKeyGoogle), | ||
| @(UIReturnKeyRoute), | ||
| @(UIReturnKeyJoin), | ||
| @(UIReturnKeyRoute), | ||
| @(UIReturnKeyEmergencyCall) | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of suggestions here:
- Can we create a
NSSet<NSNumber *>instead of anNSArray? This will be more efficient when looking up as we won't have to iterate over the array - Can we move this to a static variable out of the implementation?
(before the@implementationkeyword on top)?
The reason for 2 is that this Collection will be created and destroyed every time the method setDefaultInputAccessoryView is invoked, so it is not very efficient.
|
@elencho gentle reminder that there are some changes requested. |
Sorry I just saw your comment, will fix in few days and get back to you. Thanks for your feedback!! |
Why you think it is a bug? I feel like it is the right behavior to fall back to |
Okay i will revert |
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
/rebase - this comment automatically rebase on top of main |
is something wrong with the tests? that is blocking the merge |
|
@elencho No, nothing wrong. |
|
@cipolleschi merged this pull request in ed9978b. |
|
This pull request was successfully merged by @elencho in ed9978b. When will my fix make it into a release? | How to file a pick request? |
Summary: Related issue: facebook#43243 As [documentation](https://reactnative.dev/docs/textinput#returnkeytype) stated for the ReturnKeyType prop on the input there are different options, like "next", "go" and etc. They are actually supported on the iOS side but we can't use it in our react native app, because of the hardcoded version of DoneButton on existing code: <img width="887" alt="image" src="https://github.com/facebook/react-native/assets/53994979/9ecaf63b-675c-45f0-b737-7ae3e937584a"> So, I decided to add support for types which were in documentation ## Changelog: [IOS] [ADDED]: ReturnKeyTypes <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: facebook#43362 Test Plan: ran yarn jest react-native-codegen and yarn jest react-native, both successfully: <img width="420" alt="image" src="https://github.com/facebook/react-native/assets/53994979/c36b61f7-ef45-4062-ac5b-1dd2d0a9e544"> <img width="420" alt="image" src="https://github.com/facebook/react-native/assets/53994979/af83c22c-d110-4c28-94c1-d48ee27bfcfe"> Reviewed By: cortinico Differential Revision: D56571845 Pulled By: cipolleschi fbshipit-source-id: 74dbffb3795ab0b5c9eafa685761c2e770cd5cf9
|
@elencho @cipolleschi so, I tested
And presence of two toolbars looks really weird (if I'm using
For me it looks like a breaking change and it prevents me to migrate to 0.75 version 😐 |
|
I have a feeling like it had to be removed #43362 (comment) Because right now when you didn't specify I have a strong feeling that it's a regression 😅 Correct me if I'm wrong 😅 |
|
Hello @kirillzyusko , thank you for feedback. |
Yes, please 🙏 I also would like to get @cipolleschi opinion on that - whether it should be considered as a release blocker or not and what is the best way to resolve it here. The straightforward approach is to remove Anyway, it's just suggestions 🙃 |
|
Hi There, sorry for the issue!
We cannot stop the release, which is happening tomorrow, at this point, especially for this that has not been reported by anyone else. |
@cipolleschi got it!
That would be amazing to include this fix in 0.75.1 👍 Do you think that removing |
|
@kirillzyusko I will try to include it, but if there wont be another fix I will remove that |
|
@elencho just to understand, do you plan to look into this issue? |
Yes, I will contribute tomorrow |



Summary:
Related issue: #43243

As documentation stated for the ReturnKeyType prop on the input there are different options, like "next", "go" and etc. They are actually supported on the iOS side but we can't use it in our react native app, because of the hardcoded version of DoneButton on existing code:
So, I decided to add support for types which were in documentation
Changelog:
[IOS] [ADDED]: ReturnKeyTypes
Test Plan:
ran yarn jest react-native-codegen and yarn jest react-native, both successfully:
