Skip to content

TextInput contextMenuHidden prop not working for double tap #36619

Closed

Description

@musi1024

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

Snack, code example, screenshot, or link to a repository

Activity

  1. github-actions commented on Mar 24, 2023

    @github-actions
    ⚠️ Unsupported Version of React Native
    ℹ️ It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
  2. musi1024 commented on Mar 27, 2023

    @musi1024
    Author

    I tried using react-native 0.71 and still had this problem。

  3. tailesmd commented on May 17, 2023

    @tailesmd

    Does any one have any solution for this issue?

  4. github-actions commented on May 17, 2023

    @github-actions
    ⚠️ Unsupported Version of React Native
    ℹ️ It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
  5. 5 remaining items

  6. jeffthemaximum commented on Aug 23, 2023

    @jeffthemaximum

    I have this issue, too, on version 0.71.8. Curious if anyone has found a solution or workaround.

  7. mrshahzeb7 commented on Sep 4, 2023

    @mrshahzeb7

    any solution ?

    contextMenuHidden not workin on double tap (android)

  8. diaa-ghonim2 commented on Sep 24, 2023

    @diaa-ghonim2

    @mrshahzeb7

    have you found a solution??
    because it is happening with me on android as well.

  9. mrshahzeb7 commented on Sep 24, 2023

    @mrshahzeb7

    @mrshahzeb7

    have you found a solution??
    because it is happening with me on android as well.

    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

  10. axel127 commented on Dec 19, 2023

    @axel127

    I still have this issue on 0.72.3.

  11. fabOnReact commented on Jan 17, 2024

    @fabOnReact
    Contributor

    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

  12. ekam1408 commented on Feb 1, 2024

    @ekam1408

    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!

  13. Vincenttbk commented on Feb 8, 2024

    @Vincenttbk

    Hi @fabOnReact
    It is also happening for me on 0.72.6

  14. alanleedev commented on Jun 18, 2024

    @alanleedev
    Contributor

    This issue is fixed here: PR #45014

  15. arthedza commented on Jul 5, 2024

    @arthedza

    @alanleedev Thanks! What release will this fix go into?

  16. alanleedev commented on Jul 9, 2024

    @alanleedev
    Contributor

    @arthedza This will be released in 0.76 as it did not make the branch cut for 0.75.

  17. Lakston commented on Sep 25, 2024

    @Lakston

    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.

  18. alanleedev commented on Sep 25, 2024

    @alanleedev
    Contributor

    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.

    @Lakston We can backport it to 0.75, 0.74, 0.73. Will update here once it is released.

  19. Lakston commented on Sep 26, 2024

    @Lakston

    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) 👍

  20. Lakston commented on Oct 3, 2024

    @Lakston

    Follow up, I just saw that react native patches 75.4 just came out including this fix, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: TextInputRelated to the TextInput component.Needs: Author FeedbackStaleThere has been a lack of activity on this issue and it may be closed soon.Type: Unsupported VersionIssues reported to a version of React Native that is no longer supported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions