react-sortable-tree icon indicating copy to clipboard operation
react-sortable-tree copied to clipboard

fix: downgrade dnd version, fix the drag move delay issue

Open tianzhich opened this issue 2 years ago • 2 comments

Hi @nosferatu500 , there is a issue related to react-dnd@14. There is observable delay when I drag and move the node. And also, because the delay happend(I'm not quite sure), canDrop was not be trigged correctly, and the node was moved to a wrong place.

You could check the difference below. The first use react-dnd@14, and the second which i downgrade to @11.

Dec-02-2022 16-07-54 Dec-02-2022 16-09-27

tianzhich avatar Dec 02 '22 08:12 tianzhich

Thanks for the PR, but... Personally, I don't like to downgrade something unless it contains critical issues.

Previously, I thought about rewriting the package to hooks (react v18.0+) + react-dnd (v16.0+) (link, but there was not enough time for this.

This is the interesting issue... Hmm... Maybe I'll try to check and fix it myself in the next 2-3 weeks. (too busy right now, sorry)

nosferatu500 avatar Dec 02 '22 09:12 nosferatu500

Yes I also try to fix it this week but can't find the way. I upgrade the patch version of react-dnd (@14.0.5), but it not works. Because the react-dnd@15 remove the decortor support and use hooks instead, the only way maybe rewriting the codebase to hooks.

I'll check the branch v6 and see if i can do something based on your work. Thank you.

tianzhich avatar Dec 02 '22 10:12 tianzhich