-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to hide context menu for TextInput #17335 #18125
Conversation
…n/react-native into add-context-menu-control
@hramos Here is the new PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Its still showing the context menu. I can able to paste into the field. How to disable it? |
In which react-native version this works? |
This hasn’t been included in a release yet. |
You can always see what release any commit is in by clicking on the link and looking at the tags. This commit landed only 7 days ago, so I wouldn't expect it to be on a stable release until 0.55. |
@amhinson Were you able to confirm that this works on Android? I'm using 0.55.4, which includes the new prop, and it works on iOS, but on Android, the context menu still appears when tapping on text in the input. |
@robinheinze I did confirm that it worked on a few Android devices, although maybe some devices behave differently? |
@amhinson |
Ah good catch! I was definitely only accounting for long press. |
@amhinson Can you please add double click handler as the issue still present after almost a year? The solution works perfectly for the long press but not for the double press. Thanks a lot in advance! |
Motivation
There is currently no way to disable to context menu that automatically appears over a TextInput. This is especially troublesome if you would like to disable the user from pasting text into certain fields. This PR adds a
contextMenuHidden
property to TextInput that will hide it.Test Plan
I'm not sure if testing is necessary here. I would be happy to investigate further on how this would be tested, if deemed necessary!
Related PRs
facebook/react-native-website#95
Release Notes
[FEATURE][TextInput] - Added
contextMenuHidden
property