Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excess event listeners affecting the performance #4379

Closed
2 tasks done
FarSeeing opened this issue May 4, 2024 · 1 comment
Closed
2 tasks done

Excess event listeners affecting the performance #4379

FarSeeing opened this issue May 4, 2024 · 1 comment

Comments

@FarSeeing
Copy link

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

If you are technical, you should reporting bugs along the lines of https://marker.io/blog/how-to-write-bug-report. If you are not technical, we will make allowances, please try to make an effort to understand the process.

Describe the bug
Briefly: the sidebar elements add excess event listeners that result in the perfomance drop on every graph action like zoom/scroll

Detailed: the sidebar elements call this code from the Sidebar.js:

graph.addListener(mxEvent.ESCAPE, function(sender, evt)
{
	if (dragSource.isActive())
	{
		dragSource.reset();
	}
});

This is the amount of event listeners on the empty diagram:
image

And that's the amount if you disable he mentioned code block on the same empty diagram:
image

Since that Escape listener is used only for active drag source (sources?) - it makes sense to add the listener dynamically only on actual drag start.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 24.3.1

I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:

  • yes

Additional context
Add any other context about the problem here.

@davidjgraph
Copy link
Collaborator

Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants