prevent double prompt on file drop import

This commit is contained in:
Devin Howard 2017-02-25 13:04:00 -08:00
parent 9800cc27c6
commit 47d0faadf2
2 changed files with 5 additions and 0 deletions

View file

@ -20,6 +20,10 @@ const PasteInput = {
}, false)
window.addEventListener('drop', function(e) {
e = e || window.event
// prevent conflict with react-dropzone file uploader
if (event.target.id !== 'infovis-canvas') return
e.preventDefault()
var coords = Util.pixelsToCoords(Visualize.mGraph, { x: e.clientX, y: e.clientY })
if (e.dataTransfer.files.length > 0) {

View file

@ -14,6 +14,7 @@ class ImportDialogBox extends Component {
}
handleFile = (files, e) => {
e.preventDefault() // prevent it from triggering the default drag-drop handler
this.props.onFileAdded(files[0])
}