Skip to content
This repository has been archived by the owner on Jun 18, 2018. It is now read-only.

Conflict on drop #32

Open
chrisbuttery opened this issue May 30, 2016 · 0 comments
Open

Conflict on drop #32

chrisbuttery opened this issue May 30, 2016 · 0 comments

Comments

@chrisbuttery
Copy link

chrisbuttery commented May 30, 2016

I'm experiencing a slight conflict when dropping files into react-dropzone, resulting in the following errors.

Uncaught Invariant Violation: Expected targetIds to be an array
Uncaught Invariant Violation: Cannot call hover while not dragging.

Example:

boo

To get around this I have applied a conditional to handleTopDrop to check
that dropTargetIds exists and has a length.

handleTopDrop(e) {
  const { dropTargetIds } = this;
  this.dropTargetIds = [];

  // Make sure we have dropTargetIds
  if (!dropTargetIds || !dropTargetIds.length) {
    return;
  }

  this.actions.hover(dropTargetIds, {
    clientOffset: getEventClientOffset(e)
  });

  ...

Example:

yay

This solves my issue and quite possibly could solve #25.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant