Tuesday, 16 October 2018

getSelection not working properly in iOS 12

Functions document.getSelection() and window.getSelection() do not work in iOS 12.

The problem is reproduced in Safari, Google Chrome and WKWebView.

In iOS 11 and MacOS (any version), these functions are work.

Can you advise?

Example:

document.querySelector("#contentjs").onclick = function () {
    console.log(document.getSelection());
    document.querySelector("#result").innerHTML = document.getSelection().anchorOffset;
}

enter image description here



from getSelection not working properly in iOS 12

No comments:

Post a Comment