fix: firefox edge-case
parent
f5356c3d47
commit
526411ab25
|
@ -123,20 +123,17 @@ export const TextInput = React.forwardRef(function TextInputImpl(
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
setIsDropping(false)
|
setIsDropping(false)
|
||||||
}
|
}
|
||||||
const handleDragOver = (event: DragEvent) => {
|
|
||||||
event.preventDefault()
|
|
||||||
}
|
|
||||||
|
|
||||||
document.body.addEventListener('drop', handleDrop)
|
document.body.addEventListener('drop', handleDrop)
|
||||||
document.body.addEventListener('dragenter', handleDragEnter)
|
document.body.addEventListener('dragenter', handleDragEnter)
|
||||||
|
document.body.addEventListener('dragover', handleDragEnter)
|
||||||
document.body.addEventListener('dragleave', handleDragLeave)
|
document.body.addEventListener('dragleave', handleDragLeave)
|
||||||
document.body.addEventListener('dragover', handleDragOver)
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.body.removeEventListener('drop', handleDrop)
|
document.body.removeEventListener('drop', handleDrop)
|
||||||
document.body.removeEventListener('dragenter', handleDragEnter)
|
document.body.removeEventListener('dragenter', handleDragEnter)
|
||||||
|
document.body.removeEventListener('dragover', handleDragEnter)
|
||||||
document.body.removeEventListener('dragleave', handleDragLeave)
|
document.body.removeEventListener('dragleave', handleDragLeave)
|
||||||
document.body.removeEventListener('dragover', handleDragOver)
|
|
||||||
}
|
}
|
||||||
}, [setIsDropping])
|
}, [setIsDropping])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue