I'm implementing a custom menu when long press on a link on UIWebView.
To prevent iOS default menu, I'm using:
-webkit-touch-callout:'none'
Everything work fine in iOS 6, 7: my custom menu is shown instead of UIWebView default. But in iOS 8, a strange behavior happen.
In iOS 8, after my own menu is shown, I release touch, and the link's being load in UIWebView.
I subclass UIWindow, override sendEvent: and see the different:
In iOS 6, 7: after my own menu shown, a touchcancel was sent.
In iOS 8: nothing happen. But when I release touch, a touchend was sent and trigger link click.
I tried trigger touchcancel from javascript when my menu is begin shown, but no luck.
Is there any workaround for this situation?
For those who might be concerned in future, I managed to overcome this situation by a tricky hack:
CGPoint currentOffset = webview.scrollView.contentOffset;
[webview.scrollView setContentOffset:CGPointMake(currentOffset.x, currentOffset.y +1) animated:NO];
[webview.scrollView setContentOffset:currentOffset animated:NO];