diff --git a/blocks/library/gallery/block.js b/blocks/library/gallery/block.js
index 99e097ba55eb25..c7b69cbeab9052 100644
--- a/blocks/library/gallery/block.js
+++ b/blocks/library/gallery/block.js
@@ -12,6 +12,7 @@ import { mediaUpload } from '@wordpress/utils';
import {
IconButton,
DropZone,
+ FormFileUpload,
RangeControl,
SelectControl,
ToggleControl,
@@ -51,7 +52,8 @@ class GalleryBlock extends Component {
this.toggleImageCrop = this.toggleImageCrop.bind( this );
this.onRemoveImage = this.onRemoveImage.bind( this );
this.setImageAttributes = this.setImageAttributes.bind( this );
- this.dropFiles = this.dropFiles.bind( this );
+ this.addFiles = this.addFiles.bind( this );
+ this.uploadFromFiles = this.uploadFromFiles.bind( this );
this.state = {
selectedImage: null,
@@ -122,7 +124,11 @@ class GalleryBlock extends Component {
} );
}
- dropFiles( files ) {
+ uploadFromFiles( event ) {
+ this.addFiles( event.target.files );
+ }
+
+ addFiles( files ) {
const currentImages = this.props.attributes.images || [];
const { setAttributes } = this.props;
mediaUpload(
@@ -151,7 +157,7 @@ class GalleryBlock extends Component {
const dropZone = (