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

Fix edge and drop events slowing down the application #2978

Closed
mcharfadi opened this issue Jan 23, 2024 · 0 comments · Fixed by #2979
Closed

Fix edge and drop events slowing down the application #2978

mcharfadi opened this issue Jan 23, 2024 · 0 comments · Fixed by #2979

Comments

@mcharfadi
Copy link
Contributor

The events onConnectStart, onConnectEnd, onDrop, onDragOver, onNodeDrag, onNodeDragStart, onNodeDragStop should be wrapped in a useCallback to avoid unnecessary rendering.
The way we calculate drop position is costly since we're using useViewport() and that fonction is making components rerender with each change of the viewport. Since we need to have the actual viewport only when the drop is applied we should use screenToFlowPosition from ReactFlowInstance

@mcharfadi mcharfadi added this to the 2024.3.0 milestone Jan 23, 2024
@mcharfadi mcharfadi self-assigned this Jan 23, 2024
mcharfadi added a commit that referenced this issue Jan 23, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
@mcharfadi mcharfadi linked a pull request Jan 23, 2024 that will close this issue
39 tasks
mcharfadi added a commit that referenced this issue Jan 23, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
mcharfadi added a commit that referenced this issue Jan 23, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
sbegaudeau pushed a commit that referenced this issue Jan 26, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
mcharfadi added a commit that referenced this issue Jan 26, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
sbegaudeau pushed a commit that referenced this issue Jan 28, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
sbegaudeau pushed a commit that referenced this issue Jan 28, 2024
Bug: #2978
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant