Add multiple improvements for touch events to grids

This commit is contained in:
Andrew Kingston 2024-04-17 14:32:57 +01:00
parent c11139914f
commit 27f7b1cc15
3 changed files with 6 additions and 3 deletions

View File

@ -119,9 +119,10 @@
}
}
const onMouseUp = e => {
if ((e.touches?.length || e.button === 0) && orderable) {
const onMouseUp = () => {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
}

View File

@ -34,6 +34,7 @@ export const createActions = context => {
stickyColumn,
ui,
maxScrollLeft,
width,
} = context
let autoScrollInterval
@ -95,7 +96,7 @@ export const createActions = context => {
// Check if we need to start auto-scrolling
const $reorder = get(reorder)
const proximityCutoff = 140
const proximityCutoff = Math.min(140, get(width) / 6)
const speedFactor = 8
const rightProximity = Math.max(0, $reorder.gridLeft + $reorder.width - x)
const leftProximity = Math.max(0, x - $reorder.gridLeft)

View File

@ -29,6 +29,7 @@ export const createActions = context => {
// Prevent propagation to stop reordering triggering
e.stopPropagation()
e.preventDefault()
ui.actions.blur()
// Find and cache index