react-native icon indicating copy to clipboard operation
react-native copied to clipboard

feat(iOS): add all supported ReturnKeyTypes

Open elencho opened this issue 11 months ago • 5 comments

Summary:

Related issue: https://github.com/facebook/react-native/issues/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: image 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: image

image

elencho avatar Mar 07 '24 10:03 elencho

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,544,176 -15,551
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,900,330 -12,606
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: c13790ff1d11ef95ad04f7d7dc87f09a9cbf7025 Branch: main

analysis-bot avatar Mar 07 '24 11:03 analysis-bot

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

facebook-github-bot avatar Apr 25 '24 12:04 facebook-github-bot

@elencho gentle reminder that there are some changes requested.

cipolleschi avatar May 01 '24 13:05 cipolleschi

@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!!

elencho avatar May 01 '24 14:05 elencho

NOTE: I removed Default value, because it was causing a bug: when returnKey was undefined from js it was still showing "Default" image

elencho avatar May 08 '24 22:05 elencho

NOTE: I removed Default value, because it was causing a bug: when returnKey was undefined from js it was still showing "Default"

Why you think it is a bug? I feel like it is the right behavior to fall back to Default if nothing is specified, no?

cipolleschi avatar May 20 '24 16:05 cipolleschi

NOTE: I removed Default value, because it was causing a bug: when returnKey was undefined from js it was still showing "Default"

Why you think it is a bug? I feel like it is the right behavior to fall back to Default if nothing is specified, no?

Okay i will revert

elencho avatar May 21 '24 13:05 elencho

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

facebook-github-bot avatar May 30 '24 14:05 facebook-github-bot

/rebase - this comment automatically rebase on top of main

cipolleschi avatar May 30 '24 14:05 cipolleschi

/rebase - this comment automatically rebase on top of main

is something wrong with the tests? that is blocking the merge

elencho avatar Jun 04 '24 10:06 elencho

@elencho No, nothing wrong. I have to run the internal linter (which is different from the OSS one, unfortunately) and ask for a review internally. I'm still catching up from AppJS and the ReactConf, that's why I have been a little slow, these days.

cipolleschi avatar Jun 05 '24 14:06 cipolleschi

@cipolleschi merged this pull request in facebook/react-native@ed9978b8de307d11def9190a461fc18b881800e0.

facebook-github-bot avatar Jun 06 '24 16:06 facebook-github-bot

This pull request was successfully merged by @elencho in ed9978b8de307d11def9190a461fc18b881800e0.

When will my fix make it into a release? | How to file a pick request?

github-actions[bot] avatar Jun 06 '24 16:06 github-actions[bot]

@elencho @cipolleschi so, I tested [email protected] and... Is there a way to hide this inputAccessoryView? I always have it right now (I specified returnKeyType="none" but it still present):

And presence of two toolbars looks really weird (if I'm using KeyboardToolbar from react-native-keyboard-toolbar):

For me it looks like a breaking change and it prevents me to migrate to 0.75 version 😐

kirillzyusko avatar Aug 12 '24 13:08 kirillzyusko

I have a feeling like it had to be removed https://github.com/facebook/react-native/pull/43362#issuecomment-2101581007

Because right now when you didn't specify returnTypeKey (i. e. it's undefined) the toolbar always shows "Default" and this button doesn't do anything (i. e. I press, but nothing happens).

I have a strong feeling that it's a regression 😅 Correct me if I'm wrong 😅

kirillzyusko avatar Aug 12 '24 14:08 kirillzyusko

Hello @kirillzyusko , thank you for feedback. Just tested and you are right, I would love to contribute again here. Can I investigate this and come back with fixed solution?

elencho avatar Aug 12 '24 18:08 elencho

Can I investigate this and come back with fixed solution?

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 UIReturnKeyDefault from the Set. Or if undefined or null is coming from JS, then do not substitute the value with UIReturnKeyDefault by default and allow that value to be nil, but it may affect other places of the framework (just afraid to get NullPointerException somewhere in the code 😅).

Anyway, it's just suggestions 🙃

kirillzyusko avatar Aug 13 '24 08:08 kirillzyusko

Hi There, sorry for the issue!

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.

We cannot stop the release, which is happening tomorrow, at this point, especially for this that has not been reported by anyone else. However, we are planning todo 75.1 next week, so this fix can go in there.

cipolleschi avatar Aug 13 '24 10:08 cipolleschi

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!

However, we are planning todo 75.1 next week, so this fix can go in there.

That would be amazing to include this fix in 0.75.1 👍 Do you think that removing UIReturnKeyDefault from a set can be included in 0.75.1? Or do you want to have a different fix?

kirillzyusko avatar Aug 13 '24 11:08 kirillzyusko

@kirillzyusko I will try to include it, but if there wont be another fix I will remove that

elencho avatar Aug 13 '24 11:08 elencho

@elencho just to understand, do you plan to look into this issue?

cipolleschi avatar Aug 13 '24 15:08 cipolleschi

@elencho just to understand, do you plan to look into this issue?

Yes, I will contribute tomorrow

elencho avatar Aug 13 '24 15:08 elencho

New PR link @cipolleschi @kirillzyusko

elencho avatar Aug 14 '24 15:08 elencho