cytoscape / cytoscape.js-edgehandles

Edge creation UI extension for Cytoscape.js
MIT License
168 stars 88 forks source link

Console error in official demos - Error this.canConnect is not a function #163

Closed abulka closed 3 years ago

abulka commented 3 years ago

I'm getting this error dozens of times in the console in both the official demos and my own code.

cytoscape-edgehandles.js:784 Uncaught TypeError: this.canConnect is not a function

For example look in the console when running the official demo https://cytoscape.org/cytoscape.js-edgehandles/demo-snap.html, and simply mouse over any node to generate the error in the console.

It happens when options are passed into the initialisation

var eh = cy.edgehandles({
  snap: false
});

If you initialise with no options, there is no error.

var eh = cy.edgehandles({});
// or
let eh = cy.edgehandles();

Even when I pass in options that define a canConnect function, as per the readme documentation the error still happens?

maxkfranz commented 3 years ago

Good catch. This doesn't affect the UX in any way (i.e. it works fine for end-users in any case), which is probably why it went unnoticed in testing.

Patched in v4.0.1