Closed leighton-carr closed 11 months ago
This is meant to be a feature 😅 But I understand that it wasn't a good idea and we will probably change it with the next major release. The reason for this is that we don't pass the dimensions to the custom node to safe a re-render when nodes are getting initialized.
You can easily ~fix it on your end by getting the node dimensions from the store https://codesandbox.io/p/sandbox/young-meadow-f5spz5?file=%2FCustomResizerNode.js%3A10%2C1-14%2C1
Describe the Bug
The default NodeResizer is not triggering a node re-render for a memoized custom node, but only on the bottom-right corner. I assume this has something to do with top/left not updating for any size changes from the bottom right. This affects custom graphics elements like SVGs which do not updated because the base node element is not re-rendered.
Your Example Website or App
https://codesandbox.io/p/sandbox/fancy-cloud-fqqqp9
Steps to Reproduce the Bug or Issue
Expected behavior
As a user I expect the custom node to be re-rendered for all resize handles when following the recommended pattern of memoizing custom nodes. This will allow me to update SVG shapes within the node without handling events myself.
Screenshots or Videos
https://github.com/xyflow/xyflow/assets/18201458/ea37bc30-098c-44f8-9b27-699c8cc372ee
Platform
Additional context
We have a pro membership through another developer during our PoC phase. DM for details if required.