Programmatically deselect text in Mobile Safari


#1

Hi,
I used this to How to make text selectable? to enable copy feature in ionic.
It worked. But there is one issue.
I want to deselect text programatically.

In Android I can do this
window.getSelection().removeAllRanges()
or
document.execCommand("Unselect");

But nothing works in iOS (Mobile Safari)

Help is greatly appreciated to get deselect working in iOS.

Thank you.