Skip to content

DropZone: Avoid calling callbacks if file dropped on another dropzone#5432

Merged
gziolo merged 1 commit intomasterfrom
fix/dropzone-upload-twice
Mar 9, 2018
Merged

DropZone: Avoid calling callbacks if file dropped on another dropzone#5432
gziolo merged 1 commit intomasterfrom
fix/dropzone-upload-twice

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

@youknowriad youknowriad commented Mar 6, 2018

closes #3393 and closes #3392

The Media Modal contains a dropzone and if we try to drop a file there, it will be uploaded twice and maybe inserter into the editor canvas because the editor is full of dropzones under the modal.

This PR updates the dropzones behavior to only trigger the callbacks if the hovered dropzone is the dropzone being dropped into.

Testing instructions

  • In a post full of content
  • Try assigning a featured image by drag and dropping an image to the media modal
  • The image should upload once and should not be inserted to the post content.

@youknowriad youknowriad self-assigned this Mar 6, 2018
@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Mar 6, 2018
@youknowriad youknowriad requested a review from a team March 6, 2018 15:42
Copy link
Copy Markdown
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works as advertised 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uploading Featured Image inserts it into post content Uploading a Featured image uploads it twice

2 participants