Skip to content
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

Does not work when used over WebView. #21

Open
bhaumikdesai91 opened this issue Nov 23, 2016 · 5 comments
Open

Does not work when used over WebView. #21

bhaumikdesai91 opened this issue Nov 23, 2016 · 5 comments

Comments

@bhaumikdesai91
Copy link

I am working on a project where I need to show UIMenuController with custom option when user selects some html content in a WebView, when I place the webView inside ToolTip, it should work but It doesn't, Instead It won't even let WebView to Render.

Points to be noted:

  • I am Using alinz/react-native-webview-bridge Library for WebView and It pretty much works.
  • I want to add a custom option in the UIMenuController that performs some operation on the WebView contents.
@goshacmd
Copy link

goshacmd commented Dec 6, 2016

I have a similar use case. I'm basically requiring the NativeModule for react-native-tooltip and use it without touchable opacity (otherwise, the webview won't be handling selections at all).

@bhaumikdesai91
Copy link
Author

@goshakkk have you found any workarounds for this?

@goshacmd
Copy link

goshacmd commented Dec 6, 2016

@bhaumikdesai91 I copied https://raw.githubusercontent.com/chirag04/react-native-tooltip/master/ToolTip.ios.js locally and removed touchable opacity and such, AND I'm setting the height of Tooltip explicitly.

What really hurts me is that there's no easy way to disable system actions in the UIMenuController for a web view... the alternative would be subclassing UIWevView and making a custom bridge but I sooo don't want to go down that road :( Sucks that canPerformAction: doesn't have a delegate-based alternative

@bhaumikdesai91
Copy link
Author

bhaumikdesai91 commented Dec 6, 2016

@goshakkk In my case, I am being able to allow selection but I want to add another action in the tooltip menu. Right now it only shows default Copy,Share,Speak etc. options.I already have done this in Objective C, Take a look at this:

UIMenuItem *customMenuItem = [[UIMenuItem alloc] initWithTitle:@"CustomMenu" action:@selector(customDataProcessing)];
[[UIMenuController sharedMenuController] setMenuItems:@[customMenuItem]];
[[UIMenuController sharedMenuController] update];

What do you think?

@rajaishwary
Copy link

rajaishwary commented Oct 3, 2017

@goshakkk , @bhaumikdesai91 Any update on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants