Add multiple improvements for touch events to grids
This commit is contained in:
parent
c11139914f
commit
27f7b1cc15
|
@ -119,9 +119,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
const onMouseUp = e => {
|
||||
if ((e.touches?.length || e.button === 0) && orderable) {
|
||||
const onMouseUp = () => {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout)
|
||||
timeout = null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue