Closed b-cooper closed 5 years ago
@zyzo bump :)
Indeed, can't remember why I thought this was a good idea. @ndbroadbent feel free to challenge
Hi, sorry that was causing problems! In my app, when I clicked down and then dragged something, releasing the left mouse button would cause the click event to be fired. This caused some UX problems in my app (because a click and a drag were handled differently.) I think that's what I was trying to prevent here, but it must have been a brittle workaround if it was causing other problems.
I'm happy to just keep using this change in my own fork for now, or maybe someone can figure out a better fix for this "click after drag" issue.
Cool, if you still stumble on the problem, feel free to open an issue with a minimal project example, I'd be happy to investigate
Hello, just letting you know that I do still need this commit in my app, otherwise there's a "left click" event that is fired after the drag event finishes. In my app, this causes a UX problem because the left click is also handled.
@b-cooper Do you think there might be some other way that we can fix this without causing problems in your app?
7 includes a flag and handler to ignore the first 'click' event directly after dropping an item.
It's unclear why this change was needed and it causes unexpected functionality in my application.
In my application, after dragging and dropping an item, my next click on anything within the window is swallowed, the next click after that is registered.
This is because of the
this.preventClick
flag being set totrue
on drag end and subsequently tofalse
after a window 'click' event.@qtsd has already forked and reverted the change, plus some. I've just reverted the click handler addition here.
In the meantime, until this is merged and released, the last released version
react-dnd-mouse-backend@0.1.2
does not have this 'click-swallowing' behavior.