Skip to content

The performance of the getCell method of the CollectionHandler class is different from that of the old version after migration. #362

@Duoladuola

Description

@Duoladuola

In maxGraph0.8., When this.connectionHandler.errorequals empty string,this.connectionHandler.error && this.connectionHandler.error.length === 0equals false

image

But in the old version, the value of this expression(this.error != null && this.error.length == 0) was true

image

This is the result of the expression running on the console,the result is true

image

I made a fix in my project to keep the original functionality. If Return values for validateConnection is an empty string, I will use an empty array instead.

this.graph.getPlugin('ConnectionHandler').validateConnection = function(source, target) {
let error = null;
if (!this.isValidTarget(target)) {
error = '';
}
error = this.graph.getEdgeValidationError(null, source, target);
return error === '' ? [] : error;
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions