fix: mobile tooltip bug for files tab (#5722)
This commit is contained in:
@@ -75,6 +75,7 @@ function cleanup() {
|
|||||||
dragStarted.value = false
|
dragStarted.value = false
|
||||||
document.removeEventListener('pointermove', onPointerMove)
|
document.removeEventListener('pointermove', onPointerMove)
|
||||||
document.removeEventListener('pointerup', onPointerUp)
|
document.removeEventListener('pointerup', onPointerUp)
|
||||||
|
document.removeEventListener('pointercancel', onPointerCancel)
|
||||||
if (wasDrag) {
|
if (wasDrag) {
|
||||||
clickSuppressed = true
|
clickSuppressed = true
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
@@ -85,6 +86,10 @@ function cleanup() {
|
|||||||
|
|
||||||
let onDropCallback: ((source: FileDragData, destination: string) => void) | null = null
|
let onDropCallback: ((source: FileDragData, destination: string) => void) | null = null
|
||||||
|
|
||||||
|
function onPointerCancel() {
|
||||||
|
cleanup()
|
||||||
|
}
|
||||||
|
|
||||||
function onPointerUp() {
|
function onPointerUp() {
|
||||||
if (dragStarted.value && activeDrag.value && dragTarget.value) {
|
if (dragStarted.value && activeDrag.value && dragTarget.value) {
|
||||||
const src = activeDrag.value
|
const src = activeDrag.value
|
||||||
@@ -111,4 +116,5 @@ export function startFileDrag(
|
|||||||
|
|
||||||
document.addEventListener('pointermove', onPointerMove)
|
document.addEventListener('pointermove', onPointerMove)
|
||||||
document.addEventListener('pointerup', onPointerUp)
|
document.addEventListener('pointerup', onPointerUp)
|
||||||
|
document.addEventListener('pointercancel', onPointerCancel)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user