react-native-tooltip
react-native-tooltip copied to clipboard
Does not work when used over WebView.
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.
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).
@goshakkk have you found any workarounds for this?
@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
@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?
@goshakkk , @bhaumikdesai91 Any update on this ?