wp.media - drag&drop overlay stuck

I've got a very classical wp.media (lightbox) implementation to allow images uploading in a custom screen.

Everything works: lightbox, upload process, selection, deletion.

However as soon as I drag an image onto the lightbox and the dragdrop system is activated, the overlay saying "Drop files to upload" gets stuck and I'm not able to do anything unless I press "esc" to close the lightbox.

No Javascript error is shown in the console. Here's the code I use:

jQuery(document).delegate('.selector', 'click', function(e) {

    // Create the media frame
    file_frame = wp.media({
      title: "the title",
      button: {
        text: "btn text",
      },
      library : {type : 'image'},
      multiple: false
    });

    // if closed or selected - refresh picker
    file_frame.on('close select', function() {
        // action on closing
    });

    file_frame.open();
});

Has anyone experienced it before?

Topic drag-drop uploads wp-admin Wordpress javascript

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.