Skip to content

fix TextInput 'contextMenuHidden' prop - #45014

Closed
alanleedev wants to merge 1 commit into
react:mainfrom
alanleedev:export-D58684366
Closed

alanleedev wants to merge 1 commit into
react:mainfrom
alanleedev:export-D58684366

Conversation

@alanleedev

@alanleedev alanleedev commented Jun 17, 2024 •

Copy link
Copy Markdown
Contributor

Summary:
TextInput's contextMenuHidden prop is not working working as expected.
It should hide the context menu (copy/paste/...) that pops up from input text.

Changelog: [Android][Fixed] - TextInput's contextMenuHidden prop bug fix

Differential Revision: D58684366

@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. p: Facebook Partner: Facebook Partner labels Jun 17, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D58684366

@analysis-bot

analysis-bot commented Jun 17, 2024 •

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,443,792 -2
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,642,464 -9
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 8c7c6f3
Branch: main

Summary:
Pull Request resolved: #45014

`TextInput`'s `contextMenuHidden` prop is working working as expected.
It should hide the context menu (copy/paste/...) that pops up from input text.

Reference: [Android doc](https://developer.android.com/reference/android/widget/TextView#setCustomSelectionActionModeCallback(android.view.ActionMode.Callback))
> Returning false from `ActionMode.Callback.onCreateActionMode(ActionMode, android.view.Menu)` will prevent the action mode from being started.

**Changelog:** [Android][Fixed] - TextInput's `contextMenuHidden` prop bug fix

Differential Revision: D58684366
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D58684366

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 8a3ffb6.

@github-actions

Copy link
Copy Markdown

This pull request was successfully merged by @alanleedev in 8a3ffb6.

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

blakef pushed a commit that referenced this pull request Sep 30, 2024
Summary:
Pull Request resolved: #45014

`TextInput`'s `contextMenuHidden` prop isn't working working as expected.
It should hide the context menu (copy/paste/...) that pops up from input text.

Reference: [Android doc](https://developer.android.com/reference/android/widget/TextView#setCustomSelectionActionModeCallback(android.view.ActionMode.Callback))
> Returning false from `ActionMode.Callback.onCreateActionMode(ActionMode, android.view.Menu)` will prevent the action mode from being started.

**Changelog:** [Android][Fixed] - TextInput's `contextMenuHidden` prop bug fix

Reviewed By: javache

Differential Revision: D58684366

fbshipit-source-id: 328c267ed0e896a78e114578e3a00adf41f2e095
cipolleschi pushed a commit that referenced this pull request Oct 7, 2024
Summary:
Pull Request resolved: #45014

`TextInput`'s `contextMenuHidden` prop isn't working working as expected.
It should hide the context menu (copy/paste/...) that pops up from input text.

Reference: [Android doc](https://developer.android.com/reference/android/widget/TextView#setCustomSelectionActionModeCallback(android.view.ActionMode.Callback))
> Returning false from `ActionMode.Callback.onCreateActionMode(ActionMode, android.view.Menu)` will prevent the action mode from being started.

**Changelog:** [Android][Fixed] - TextInput's `contextMenuHidden` prop bug fix

Reviewed By: javache

Differential Revision: D58684366

fbshipit-source-id: 328c267ed0e896a78e114578e3a00adf41f2e095
kirillzyusko added a commit to kirillzyusko/react-native-keyboard-controller that referenced this pull request Nov 15, 2024
## 📜 Description

Update `react-native` to `0.76.2`.

## 💡 Motivation and Context

To stay up-do-date with ecosystem.

Key points:
- enabled Hermes on Android (JSC was crashing app on startup);
- enable `contextMenuHidden` only on iOS (see
react/react-native#45014 - now if we select
entire text the cursor gets moved to the end and we don't handle the
event when cursor is located in the end).

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### JS

- update all deps to its latest versions;

### Android

- enabled Hermes, since we get a crash on startup.

## 🤔 How Has This Been Tested?

tested on:
- CI;
- Pixel 7 Pro (Android 15);
- iPhone 6s (iOS 15.8);

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants