Improve phone usability of sortable drags

This commit is contained in:
Cohee
2023-08-18 13:41:46 +03:00
parent 1e0e5225ca
commit c4d8d70103
6 changed files with 19 additions and 7 deletions

View File

@ -8,6 +8,11 @@ export function isDigitsOnly(str) {
return /^\d+$/.test(str);
}
// Increase delay on touch screens
export function getSortableDelay() {
return navigator.maxTouchPoints > 0 ? 750 : 100;
}
export function shuffle(array) {
let currentIndex = array.length,
randomIndex;