react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]
MIT License
145 stars 97 forks source link

valid/invalid Drag icon bug #52

Open arackaf opened 7 years ago

arackaf commented 7 years ago

image

It looks like there's a slight bug with the drag icon - see the attached image. If you drag in item from deep within a hierarchy, when you get outside the whole list, the icon shows the valid "rectangle" as though you're over a valid drop target.

If you drag a top-level item, like Biology, then everything's fine, and the invalid drop icon shows when you get above the main list.

If someone can point me in the right direction I'd be happy to try to find a fix for this.

arackaf commented 7 years ago

Digging further, it appears as though this happens occasionally when the dragging / hovering fires a Redux action that subsequently changes the rendering of the hovered drop target.

Again - if someone can point me in the right direction, I'd be happy to give this a look.

arackaf commented 7 years ago

I'll just add, for anyone who might find their way to this case from Google - my problem wound up being caused by missing keys (a dumb thing to do - don't ignore the warnings).

I'm guessing lack of keys was causing React to re-render lots of list items, which somehow got tangled up with react-dnd.

Hope that helps someone.

@gaearon - apologies for all the notifications from me :)