Add prevent select helper to stop highlighting UI elements on drag with touch devices
This commit is contained in:
13
src/hooks/usePreventSelect.js
Normal file
13
src/hooks/usePreventSelect.js
Normal 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;
|
||||
Reference in New Issue
Block a user