diff --git a/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js b/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js index dacfe6c534..3298563bbd 100644 --- a/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js +++ b/src/bundle/ui-dev/src/modules/multi-file-upload/components/drop-area/drop.area.component.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { Component, createRef } from 'react'; import PropTypes from 'prop-types'; import { getTranslator } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/context.helper'; @@ -10,6 +10,7 @@ export default class DropAreaComponent extends Component { super(props); this._refFileInput = null; + this._refForm = createRef(); this.hasMultiMsgForFileSizes = this.props.maxFileSizes.length > 1; this.state = { @@ -104,6 +105,8 @@ export default class DropAreaComponent extends Component { componentDidMount() { window.addEventListener('drop', this.props.preventDefaultAction, false); window.addEventListener('dragover', this.props.preventDefaultAction, false); + + this._refForm.current.addEventListener('drop', this.handleUpload, false); } componentWillUnmount() { @@ -122,7 +125,7 @@ export default class DropAreaComponent extends Component { }); return ( -