I have several custom UIMenuItems that do things with a selection in a UIWebView. After the action has been run on that selection I want to hide the selection handles just as copy: does.
I have tried using window.getSelection().removeAllRanges(); and that works in that window.getSelection() no longer returns anything but the text selection handles stay visible.
Is there a way to remove the selection and the handles with it?
Edit: I don't need it to be a JS solution but I can't loose the state by reloading the webview.
Just disable and re-enable the User Interaction:
myWebView.userInteractionEnabled = NO;
myWebView.userInteractionEnabled = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With