Fix selection of text when 3D touching a token on iOS

This commit is contained in:
Mitchell McCaffrey
2021-06-17 11:30:06 +10:00
parent 4e2d14e7ac
commit 78dac55d7a
2 changed files with 17 additions and 1 deletions
+9
View File
@@ -1,5 +1,14 @@
function usePreventSelect() {
function clearSelection() {
if (window.getSelection) {
window.getSelection().removeAllRanges();
}
if (document.selection) {
document.selection.empty();
}
}
function preventSelect() {
clearSelection();
document.body.classList.add("no-select");
}