antvis / XFlow

React component for building interactive diagrams.
https://x6.antv.antgroup.com/xflow/guide/introduction
MIT License
573 stars 235 forks source link

流程图上的一次操作,需要执行两次或者多次撤销动作才能回到上一个状态 #270

Closed MrMengJ closed 1 year ago

MrMengJ commented 2 years ago

问题描述

流程图上对图形的一次操作,需要执行两次或者多次撤销动作才能回到上一个状态

重现链接

https://codesandbox.io/s/ysquyr

重现步骤

1、进入页面,添加一个图形 2、移动或者放大这个图形,ctrl+z 撤销,需要操作两次才能撤销回去

预期行为

任何操作都只需要撤销一次就能撤销到上一次的状态

平台

屏幕截图或视频(可选)

No response

补充说明(可选)

经过排查,是因为XFlow会将图形的所有数据存放在data中,在每次更新图形时(比如 移动,放大缩小)会将图形最新的数据再次同步到data中,导致X6记录了至少两次的入栈,一次是真实操作改变数据的入栈,一次是更新data导致的入栈,这就导致了需要撤销两次才能撤回到原来的状态。

xflow-bot[bot] commented 2 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

MrMengJ commented 2 years ago

unstable

xflow-bot[bot] commented 2 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

MrMengJ commented 2 years ago

unstable

xflow-bot[bot] commented 2 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

xflow-bot[bot] commented 1 year ago

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot 🤖, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the AntV community! 💪💯

ws2332332 commented 1 year ago

可以设置条件,过滤一些操作 image

MrMengJ commented 1 year ago

可以设置条件,过滤一些操作 image

感谢回复,已将在项目上这样用上了,但我认为这是xflow设计上的问题

xflow-bot[bot] commented 10 months ago

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.