Repository navigation
TextInput contextMenuHidden prop not working for double tap #36619
Description
Description
Hello,
I'm experiencing an issue with the TextInput component. When I set the contextMenuHidden prop to true, I expect the default context menu to be disabled and not appear when double tapping on the input field. However, the context menu still appears on double tap.
Expected behavior:
The default context menu should not appear when double tapping on the input field.
Actual behavior:
The default context menu still appears when double tapping on the input field.
Environment:
Operating system: [e.g. Android]
React Native version: 0.67.2
React Native Version
0.67.2
Output of npx react-native info
System:
OS: macOS 13.2.1
CPU: (8) arm64 Apple M1
Memory: 111.06 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.21.3 - ~/.nvm/versions/node/v14.21.3/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 6.14.18 - ~/.nvm/versions/node/v14.21.3/bin/npm
Watchman: 2023.03.06.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/xxx/.rvm/gems/ruby-2.7.4/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 25, 27, 28, 30, 33, 33
Build Tools: 30.0.2
System Images: android-30 | ARM 64 v8a, android-30 | Intel x86_64 Atom, android-30 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.18 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.2 => 0.67.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Steps to reproduce:
- Add a TextInput component to a screen
- Set the contextMenuHidden prop to true
- Double tap on the input field
Activity
github-actions commentedon Mar 24, 2023
musi1024 commentedon Mar 27, 2023
I tried using react-native 0.71 and still had this problem。
tailesmd commentedon May 17, 2023
Does any one have any solution for this issue?
github-actions commentedon May 17, 2023
5 remaining items
jeffthemaximum commentedon Aug 23, 2023
I have this issue, too, on version
0.71.8. Curious if anyone has found a solution or workaround.mrshahzeb7 commentedon Sep 4, 2023
any solution ?
contextMenuHidden not workin on double tap (android)
diaa-ghonim2 commentedon Sep 24, 2023
@mrshahzeb7
have you found a solution??
because it is happening with me on android as well.
mrshahzeb7 commentedon Sep 24, 2023
I didn't found a proper solution for Android so i handled it through code
Just don't allow user to select text in the text input
This is what I did
https://stackoverflow.com/a/54897489
axel127 commentedon Dec 19, 2023
I still have this issue on 0.72.3.
fabOnReact commentedon Jan 17, 2024
Do you still experience this issue?
I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs.
If you still experience this issue, I will prepare a patched release with the fix.
Thanks a lot
ekam1408 commentedon Feb 1, 2024
Hey @fabOnReact
I'm still facing this issue on 0.72.4
It would be great if you could add a fix for this. Thank you!
Vincenttbk commentedon Feb 8, 2024
Hi @fabOnReact
It is also happening for me on 0.72.6
alanleedev commentedon Jun 18, 2024
This issue is fixed here: PR #45014
arthedza commentedon Jul 5, 2024
@alanleedev Thanks! What release will this fix go into?
alanleedev commentedon Jul 9, 2024
@arthedza This will be released in 0.76 as it did not make the branch cut for 0.75.
Lakston commentedon Sep 25, 2024
will this patch be rolled out on earlier versions too ? Since 0.76 will bump ios minimum version to iOS 15.1, updating to 0.76 is not a viable solution for a lot of projects.
alanleedev commentedon Sep 25, 2024
@Lakston We can backport it to 0.75, 0.74, 0.73. Will update here once it is released.
Lakston commentedon Sep 26, 2024
Great news thanks, we are using 73 at the moment but I have the update to 75 in sight (since we can't update to 76, that would cut off too many users on our end) 👍
Lakston commentedon Oct 3, 2024
Follow up, I just saw that react native patches 75.4 just came out including this fix, thanks 👍