Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collection undefined when used with other drag and drop components #171

Closed
wants to merge 1 commit into from

Conversation

szszoke
Copy link
Contributor

@szszoke szszoke commented Mar 26, 2017

#170
Returning find only when this.active is not undefined fixes the issue.

@clauderic
Copy link
Owner

clauderic commented Apr 5, 2017

Hey @szabolcsx, while this does look like it fixes the issue you ran into, I think the root of the issue must be somewhere else, as getActive() should never be called in the first place if this.active is undefined

@szszoke
Copy link
Contributor Author

szszoke commented Apr 12, 2017

I see. I will investigate further the problem.

@clauderic
Copy link
Owner

Much appreciated, thank you 🙏

@szszoke
Copy link
Contributor Author

szszoke commented Apr 22, 2017

Hi,

I think I found the cause: the problem appeared when I started to move the cursor. I think the mouse move event was bubbling up, so I just had to do the following to stop that:

<Draggable
    { ...props }
    onDrag={event => event.stopPropagation()} />

@elie222
Copy link

elie222 commented Dec 23, 2018

stopPropagation doesn't seem to be the best solution with React Draggable as it will stop the drag handle moving. For others looking I recommend using: shouldCancelStart.

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

Successfully merging this pull request may close these issues.

3 participants