Excess event listeners affecting the performance
Preflight Checklist
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] 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:
And that's the amount if you disable he mentioned code block on the same empty diagram:
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.