antvis/G6


The issue has been closed
[v5] When do undo/redo, node position is updated incorrectly #5690
hongwei0417 posted onGitHub
Describe the bug
The node position only be updated to old y-axis position, when do undo/redo.
I found a bug in item-data-command
from 5.0.0-beta.28
which the data doesnt have nodeId.
https://github.com/antvis/G6/blob/9b20b27d9ddcd942399ad638dd6a8e22168cdaa7/packages/g6/src/stdlib/plugin/history/item-data-command.ts#L69C41-L69C47
Your Example Website or App
https://g6-next.antv.antgroup.com/examples/tool/history#history
Steps to Reproduce the Bug or Issue
- Move the node to random position
- Call undo api
- The node position is only be updated to old y-axis position
Expected behavior
The node position need to be updated both of x-axis and y-axis.
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response