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
version 3.1.2 (fixes) #1366
version 3.1.2 (fixes) #1366
Conversation
setTimeout(() => { | ||
setHintTooltipOpen(false); | ||
setSortTooltipOpen(false); | ||
setDragging(true); | ||
}, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell what this is❓
why use setTimeout..
ref : https://react-dnd.github.io/react-dnd/docs/api/use-drag
begin(monitor): Optional. Fired when a drag operation begins. Nothing needs to be returned, but if an object is returned it will override the default item property of the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An attempt to solve #1359 - I cannot reproduce that issue. I found this thread: react-dnd/react-dnd#1085 - it had a workaround that seemed related to what the guy was describing. Wrapping in setTimeout doesn't really have ill effects, it's just odd. I also can't reproduce #1363. I tried creating an example with other react-dnd componets but everything seems to work fine. I found this issue: react-dnd/react-dnd#1571 and it had a harmless solution so I added that in. Hopefully that will resolve the problem that guy is seeing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the kind explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be okay to change to Immediately-invoked function expression
.
I'll test it and tell you again
This release would fix the following: