react-native-tooltip icon indicating copy to clipboard operation
react-native-tooltip copied to clipboard

Does not work when used over WebView.

Open bhaumikdesai91 opened this issue 8 years ago • 5 comments

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.

bhaumikdesai91 avatar Nov 23 '16 11:11 bhaumikdesai91

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

goshacmd avatar Dec 06 '16 12:12 goshacmd

@goshakkk have you found any workarounds for this?

bhaumikdesai91 avatar Dec 06 '16 13:12 bhaumikdesai91

@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

goshacmd avatar Dec 06 '16 13:12 goshacmd

@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?

bhaumikdesai91 avatar Dec 06 '16 13:12 bhaumikdesai91

@goshakkk , @bhaumikdesai91 Any update on this ?

rajaishwary avatar Oct 03 '17 10:10 rajaishwary