react-native/packages
Mateo Guzmán 32931466ed feat(text-input): [iOS] inputAccessoryViewButtonLabel prop (#47441)
Summary:
Fixes https://github.com/facebook/react-native/issues/29244, also mentioned in https://github.com/facebook/react-native/issues/25009

As mentioned in the linked issues, the current return key label in the input accessory view is not localized. In the code, right now the texts are hardcoded (see: [RCTTextInputComponentView.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm#L552) and [RCTBaseTextInputView.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L694)). I could not find the historical reason for this, but doing some investigation there doesn't seem to be a way of getting the translated text into the code by using the existing props. (Ref: https://stackoverflow.com/a/58190342/5415299)

The solution: adding a new property `inputAccessoryViewButtonLabel` which can be used to overwrite these defaults non-translated values. The property is optional to avoid breaking changes.

The implementation works for both Fabric and Paper.

## Changelog:

[IOS] [ADDED] - TextInput `inputAccessoryViewButtonLabel` prop

Pull Request resolved: https://github.com/facebook/react-native/pull/47441

Test Plan:
A new example has been added under the `TextInput` examples in the RNTester. See below:

<details>
<summary>Video demonstrating how the new prop behaves</summary>

https://github.com/user-attachments/assets/b15cb8b8-494a-4f41-b434-e33eeef5d267

</details>

Reviewed By: cipolleschi

Differential Revision: D65533493

Pulled By: javache

fbshipit-source-id: d80bf501ba3e38bf3b09833170780df45a26bb61
2024-11-13 06:44:23 -08:00
..
assets
babel-plugin-codegen
community-cli-plugin
core-cli-utils
debugger-frontend
dev-middleware
eslint-config-react-native
eslint-plugin-react-native
eslint-plugin-specs
gradle-plugin RNGP - Do not attempt to substring to 1024 while logging. (#47509) 2024-11-08 04:57:15 -08:00
helloworld Let lib maintainer be explicit with componentProvider mapping (#47520) 2024-11-12 07:38:03 -08:00
hermes-inspector-msggen
metro-config
normalize-color
polyfills Implement always available js error handling (#47466) 2024-11-07 11:22:57 -08:00
react-native feat(text-input): [iOS] inputAccessoryViewButtonLabel prop (#47441) 2024-11-13 06:44:23 -08:00
react-native-babel-preset
react-native-babel-transformer
react-native-bots
react-native-codegen Pre-suppress errors to prepare for flow typing changes 2024-11-08 08:39:06 -08:00
react-native-codegen-typescript-test
react-native-info
react-native-popup-menu-android
react-native-test-library Let lib maintainer be explicit with componentProvider mapping (#47520) 2024-11-12 07:38:03 -08:00
react-native-test-renderer
rn-tester feat(text-input): [iOS] inputAccessoryViewButtonLabel prop (#47441) 2024-11-13 06:44:23 -08:00
typescript-config
virtualized-lists Revert React 19RC to React 18.3.1 (#47380) 2024-11-08 08:27:37 -08:00