You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a workaround by converting the numeric ID to a string with 'node-' prefix:
editor.removeNodeId('node-'+nodeId);
This resolves the error and the node is removed as expected.
Suggestion
It would be helpful if removeNodeId could handle numeric IDs directly! Alternatively, changing the documentation to specify the expected ID format would be great.
Additional Information
Drawflow Version: 0.0.60
Browser: Chrome Version 128.0.6613.138 (Official Build) (arm64)
Operating System: macOS 14.1.1 (23B81)
Thank you for your time and for developing this useful library!
The text was updated successfully, but these errors were encountered:
Hey, thanks for the quick response, I already thought it would be something like that, makes sense :)
Maybe it would make it a bit easier for beginners if you were to add a small paragraph to the readme, maybe something like:
In Drawflow, some functions expect node IDs as "node-x" strings (e.g., "node-5"), while others use numeric IDs (e.g., 5). This is intentional to maintain compatibility with previous versions and avoid breaking changes.
I'm encountering an error when trying to remove a node using
editor.removeNodeId(nodeId)
in the Drawflow library. The error message is:It seems that
removeNodeId
expects the node ID to be a string to always start with'node-'
Steps to Reproduce
Add a Node:
addNode
returns a numericnodeId
.Attempt to Remove the Node:
Error Occurs:
Workaround
I found a workaround by converting the numeric ID to a string with
'node-'
prefix:This resolves the error and the node is removed as expected.
Suggestion
It would be helpful if
removeNodeId
could handle numeric IDs directly! Alternatively, changing the documentation to specify the expected ID format would be great.Additional Information
Thank you for your time and for developing this useful library!
The text was updated successfully, but these errors were encountered: