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

设置循环渲染的数据后不触发 History 的 onChangeState 事件,不能点击撤销 #3020

Open
zj131711 opened this issue May 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working / 明确是 bug

Comments

@zj131711
Copy link

zj131711 commented May 10, 2024

Describe the bug (required) / 详细描述 bug(必填)

document.history 用来实现 undo/redo 功能,当schema发生变更时可以记录到 history 的 records 里面,并且state改变时会抛出 onChangeState 事件,但只有在设置循环渲染的数据后会出现不触发 onChangeState 事件,undo按钮也无效。


To Reproduce (required) / 如何复现 bug?(必填,非常重要)

Steps to reproduce the behavior: / 详细复现步骤:
以下是简化场景的重新步骤

  1. 打开demo页面 https://lowcode-engine.cn/demo/demo-basic-antd/index.html
  2. 重置页面后,拖入1个Avatar组件(其他组件也一样),选中组件,在右边切换到“高级”Tab,此时Avatar的schema会自动增加
    "loopArgs": [ null, null ],撤销按钮会亮起,直接保存(或者切回其他tab修改之后保存也一样的)
  3. 刷新页面,切换到Avatar的“高级”Tab,点击"循环数据"的“编辑数据”,填写任意值例如 [1, 2] 之后点击确认,Avatar 成功在画布中渲染为2个
  4. 问题出现了:撤销按钮未亮起,点击无法撤销。期望结果是可以点击撤销对循环数据的配置。

调试后发现,与其他setter的变动相比较,虽然同样触发了 AliLowCodeEngine/editor-skeleton/src/components/settings/settings-pane.tsxfield.setValue(value, true);,但是这种情况下不会进入下一步 AliLowCodeEngine/designer/src/document/history.ts 的 MobX reaction 的监听函数,所以不会触发状态改变。但还查不到为什么。

Screenshots (optional) / bug 截图(可选)

Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题


Environments (please complete the following information) (required): / 请提供如下信息(必填)

  • AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
  • AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
  • Browser [e.g. chrome, safari] / 浏览器版本
  • materials / plugins / tools / 其他物料 / 插件 / 工具链版本

(this information can be collected via the manual plugin / 版本信息可通过低代码用户手册插件收集)

Additional context (optional) / 更多额外信息(可选)

Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题

@zj131711 zj131711 changed the title 设置循环渲染的数据后 不触发 onChangeState 事件,不能点击撤销 设置循环渲染的数据后不触发 History 的 onChangeState 事件,不能点击撤销 May 10, 2024
@1ncounter 1ncounter self-assigned this May 16, 2024
@1ncounter 1ncounter added the bug Something isn't working / 明确是 bug label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working / 明确是 bug
Projects
None yet
Development

No branches or pull requests

2 participants