Closed cristianoccazinsp closed 4 years ago
Update: Just confirmed and reproduced the issue on both iOS and Android.
While dragging a node (1 finger), tap the screen with another finger, and move both fingers at the same time. After this, the node will become stuck and there's no way to drag it again.
Any ideas on this? Can be reproduced very easily by just tapping with a second finger while dragging with 1.
Long story short: It's broken and nobody managed to find the time to fix it yet.
Is it an old/known issue? I know I have been bothering for a while already and promising fixing stuff myself, but I may definitely tackle this one if I find the root of the problem :D
I don't know if it's a known issue. I didn't know about it but I'm not here all that long, there are issues unsolved all the way from Almende times.
If you want to look at it, first of all thanks, help is really appreciated here. The problem is most likely in https://github.com/visjs/vis-network/blob/master/lib/network/modules/InteractionHandler.js that's the module responsible for dragging and other interaction.
At first sight, I can't see anything wrong with the code (from just the above file). Debugging also doesn't show any crash/error, and in fact all events are fired with the node that's "stuck" just fine, but the node doesn't update its position.
I guess I have no other option than to download the whole source code and run it :(
I believe I have found the issue! The code relies on matched drag start/end event pairs. However, when dragging on a touch screen, there's a chance that two drag start events will be fired, but only one drag end, causing the node to end up "fixed".
Related lines: https://github.com/visjs/vis-network/blob/master/lib/network/modules/InteractionHandler.js#L316 https://github.com/visjs/vis-network/blob/master/lib/network/modules/InteractionHandler.js#L371 https://github.com/visjs/vis-network/blob/master/lib/network/modules/InteractionHandler.js#L411
The fix is to just prevent the drag start code from firing if already dragging. I'm not sure if adding this check would introduce any new bugs. I will test and submit a PR.
Basically, adding a line here: https://github.com/visjs/vis-network/blob/master/lib/network/modules/InteractionHandler.js#L291
if(this.drag.dragging){ return; }
Thoughts?
:tada: This issue has been resolved in version 7.6.10 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Still trying to figure out what triggers the bug, but when running an example in a WebView (mobile), moving the canvas with 2 fingers while quickly tapping nodes will sometimes break a node, leaving it stuck permanently.
Is there any hidden behaviour I'm not aware of that will switch nodes to the "fixed" state?