X6 icon indicating copy to clipboard operation
X6 copied to clipboard

undo redo 节点数据丢失问题

Open wb-wenbei opened this issue 1 year ago • 5 comments

Describe the bug

在对节点进行undo/redo操作时,一旦undo将节点删除,再redo将节点还原,节点修改过的数据就会丢失。

Your Example Website or App

https://codesandbox.io/p/sandbox/reverent-flower-38qz45

Steps to Reproduce the Bug or Issue

1.打开页面,自动添加节点 2.点击change按钮,更改节点数据 3.点击get按钮,获取节点数据 20-20 4.点击undo按钮,撤销数据更改 5.点击undo按钮,撤销节点添加 6.点击redo按钮,还原节点添加 7.点击redo按钮,还原数据更改 8.点击get按钮,获取节点数据 10-10

Expected behavior

8点击get按钮,获取节点数据 20-20

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • @antv/x6 [2.18.1]
  • @antv/x6-plugin-history [2.2.4]

Additional context

No response

wb-wenbei avatar May 14 '24 10:05 wb-wenbei

image 打不开

cuidong626 avatar May 16 '24 08:05 cuidong626

你是不是每一个步骤都添加到历史记录里面去了,数据的操作你应该要从历史记录中剔除掉的

zlecheng avatar May 16 '24 08:05 zlecheng

image 打不开

@cuidong626 https://codesandbox.io/p/sandbox/reverent-flower-38qz45

wb-wenbei avatar May 16 '24 09:05 wb-wenbei