-
Notifications
You must be signed in to change notification settings - Fork 20.3k
Open
Description
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Description
Description
In web/app/components/workflow/nodes/_base/hooks/use-resize-panel.ts, resize-related global listeners are registered in a useEffect (mousemove / mouseup on document).
I noticed the mouseup cleanup path may be incomplete (or was commented out in some revisions), which can cause inconsistent listener lifecycle management.
useEffect(() => {
const element = triggerRef.current
element?.addEventListener('mousedown', handleStartResize)
document.addEventListener('mousemove', handleResize)
document.addEventListener('mouseup', handleStopResize)
return () => {
if (element)
element.removeEventListener('mousedown', handleStartResize)
document.removeEventListener('mousemove', handleResize)
}
}, [handleStartResize, handleResize, handleStopResize])Potential risks:
- duplicated
mouseuphandlers after re-renders/re-mounts handleStopResizefiring multiple times- retained listeners causing potential memory/performance issues
Motivation
No response
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels