Add prevent select helper to stop highlighting UI elements on drag with touch devices

This commit is contained in:
Mitchell McCaffrey
2021-06-09 23:25:28 +10:00
parent 8b0ee7075d
commit 21986231fa
4 changed files with 48 additions and 6 deletions

View File

@@ -0,0 +1,13 @@
function usePreventSelect() {
function preventSelect() {
document.body.classList.add("no-select");
}
function resumeSelect() {
document.body.classList.remove("no-select");
}
return [preventSelect, resumeSelect];
}
export default usePreventSelect;