alibaba / alibaba/lowcode-engine

history.back/forward无法还原modal-node的hidden属性,导致模态框(对话框)中编辑后redo/undo失效问题

Open
#3,080 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

## **在Modal模态框节点中编辑子组件后,redo/undo无法正常撤销和还原**

查看源码发现在DocumentModel中,通过importSchema的方式来实现redo/undo,会重建ModalNodesManager。
导致Modal节点的hidden属性被重置(即使schema中的hidden是false)。

所以在编辑Modal节点中编辑子组件后,redo/undo会导致Modal隐藏。
用户想要查看redo/undo是否生效,会再次点开Modal。此时会打乱history的records,无法使用redo/undo。

请问这个问题,有没有好的规避方法?

---

## **复现步骤**

1、打开Antd组件官方Demo:https://lowcode-engine.cn/demo/demo-basic-antd/index.html

2、拖入“反馈>普通型”Modal组件。

3、在Modal内,拖入“主按钮”组件。

4、键盘操作“undo”,或者点击头部“撤销”按钮。Modal隐藏。

5、大纲树中点击Modal,打开检查,“主按钮”组件被删除。

6、键盘操作“redo”,或者点击头部“恢复”按钮。Modal依旧隐藏,“主按钮”组件不会恢复。

---

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with DocumentModel's importSchema flow and the ModalNodesManager handling described in the issue, then reproduce the behavior in the Antd demo with a Modal containing a button. Trace why the Modal node's hidden state changes during undo and redo; done means the child component is removed and restored while the Modal remains usable and history is not disrupted.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.