Add multiple improvements for touch events to grids
This commit is contained in:
parent
c11139914f
commit
27f7b1cc15
|
@ -119,9 +119,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onMouseUp = e => {
|
const onMouseUp = () => {
|
||||||
if ((e.touches?.length || e.button === 0) && orderable) {
|
if (timeout) {
|
||||||
clearTimeout(timeout)
|
clearTimeout(timeout)
|
||||||
|
timeout = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ export const createActions = context => {
|
||||||
stickyColumn,
|
stickyColumn,
|
||||||
ui,
|
ui,
|
||||||
maxScrollLeft,
|
maxScrollLeft,
|
||||||
|
width,
|
||||||
} = context
|
} = context
|
||||||
|
|
||||||
let autoScrollInterval
|
let autoScrollInterval
|
||||||
|
@ -95,7 +96,7 @@ export const createActions = context => {
|
||||||
|
|
||||||
// Check if we need to start auto-scrolling
|
// Check if we need to start auto-scrolling
|
||||||
const $reorder = get(reorder)
|
const $reorder = get(reorder)
|
||||||
const proximityCutoff = 140
|
const proximityCutoff = Math.min(140, get(width) / 6)
|
||||||
const speedFactor = 8
|
const speedFactor = 8
|
||||||
const rightProximity = Math.max(0, $reorder.gridLeft + $reorder.width - x)
|
const rightProximity = Math.max(0, $reorder.gridLeft + $reorder.width - x)
|
||||||
const leftProximity = Math.max(0, x - $reorder.gridLeft)
|
const leftProximity = Math.max(0, x - $reorder.gridLeft)
|
||||||
|
|
|
@ -29,6 +29,7 @@ export const createActions = context => {
|
||||||
|
|
||||||
// Prevent propagation to stop reordering triggering
|
// Prevent propagation to stop reordering triggering
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
e.preventDefault()
|
||||||
ui.actions.blur()
|
ui.actions.blur()
|
||||||
|
|
||||||
// Find and cache index
|
// Find and cache index
|
||||||
|
|
Loading…
Reference in New Issue