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

x6-plugin-history 插件设置{ ignoreChange: true } 以后, 还原连线删除操作时,连线找不到target #4487

Open
htp411 opened this issue Oct 31, 2024 · 1 comment

Comments

@htp411
Copy link

htp411 commented Oct 31, 2024

Describe the bug

配置项

// 忽略添加和删除之外的所有操作
graph.use(new History({
  ignoreChange: true,
}))

graph.on('history:undo', ({ cmds }) => {
  console.log(cmds);
  // 删除时其实是有两条记录:删除和改变target,由于改变target这个记录会被忽略,导致还原删除的时候,连线找不到终点
  /*
   *{batch: true, data: {…}, event: 'cell:added', options: {…}}
   *{batch: true, data: {…}, event: 'cell:change:target', options: {…}}
  */
})

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-1dbuk4?file=src%2Fstyle.css

Steps to Reproduce the Bug or Issue

  1. x6-plugin-history 插件设置{ ignoreChange: true }
  2. 增加连线
  3. control + z 撤销
  4. control + shift + z 还原
  5. 连线找不到target节点

Expected behavior

x6-plugin-history 插件设置{ ignoreChange: true } 以后, 还原连线删除操作时,连线能正常找到target节点

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version:
    • "@antv/x6": "^2.18.1",
    • "@antv/x6-plugin-history": "^2.2.4",

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Oct 31, 2024

👋 @htp411

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant