fix(web): loop/iteration edge

This commit is contained in:
zhaoying
2026-04-09 11:45:41 +08:00
parent 5eb65e7ad8
commit cc373b2864
2 changed files with 108 additions and 102 deletions

View File

@@ -34,9 +34,12 @@ const PortClickHandler: React.FC<PortClickHandlerProps> = ({ graph }) => {
};
window.addEventListener('port:click', handlePortClick as EventListener);
const handleBlankClick = () => handlePopoverClose();
window.addEventListener('blank:click', handleBlankClick);
return () => {
window.removeEventListener('port:click', handlePortClick as EventListener);
window.removeEventListener('blank:click', handleBlankClick);
};
}, []);