Hareeshchandera / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Click event fired twice when CANVAS is used #219

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If Canvas is used, the following code will show the alert twice:

jsPlumb.bind('click', function(c) { 
  alert(c.id);
});

With SVG it works Ok.

Tested in FF 9.0.1 an Chrome 11.

Original issue reported on code.google.com by bandino....@gmail.com on 9 Mar 2012 at 9:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
i can't reproduce this.  are you sure you haven't bound to that event twice?

Original comment by simon.po...@gmail.com on 9 Mar 2012 at 11:37

GoogleCodeExporter commented 8 years ago
I have tried once again, with console.log(c.id) and it was logged twice.

I used jQuery stateMachineDemo.html, so I did not bound the click event twice.

This is happening only when CANVAS mode is used. For SVG it works fine.
I tested with jsPlumb 1.3.7

Original comment by bandino....@gmail.com on 11 Mar 2012 at 9:22

GoogleCodeExporter commented 8 years ago
yeah i still can't reproduce it.  i deleted the question about console.log 
since i cannot reproduce the click thing (i thought it might have been some 
mouse event bubble type problem).

i will need a jsfiddle that shows this behaviour or i'll have to close this.

Original comment by simon.po...@gmail.com on 11 Mar 2012 at 9:27

GoogleCodeExporter commented 8 years ago
I have attached the files. See the demo/jquery/stateMachineDemo.html.

Original comment by bandino....@gmail.com on 11 Mar 2012 at 11:25

Attachments:

GoogleCodeExporter commented 8 years ago
It seems that the jsPlumb.select() will also return duplicated connections.

I added some alerts that will shown the number of connections of the source 
node and then alert them all. You will see that each connection is shown twice. 
Please see the attached example.

Original comment by bandino....@gmail.com on 12 Mar 2012 at 10:53

Attachments:

GoogleCodeExporter commented 8 years ago
yeah i was looking at this; that is the underlying problem, that there are 
multiple connections registered.

Original comment by simon.po...@gmail.com on 12 Mar 2012 at 6:35

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 12 Mar 2012 at 9:55

GoogleCodeExporter commented 8 years ago
fixed in 1.3.8, which i will release soon.

thanks for your persistence ;)

Original comment by simon.po...@gmail.com on 13 Mar 2012 at 12:55

GoogleCodeExporter commented 8 years ago
1.3.8 was released today.

Original comment by simon.po...@gmail.com on 1 Apr 2012 at 7:52