Fix: Fix undo/redo while action menu is open (#6273)

* Add data attribute to modals for testing

* Add test for undoing with action menu open not destroying text

* Add test for undo closing the action menu

* Add simple fix for undo/redo with action menu open

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
This commit is contained in:
Phoenix Eliot
2022-08-15 06:58:35 -04:00
committed by GitHub
parent d5adf85f58
commit 9d9d8b3474
2 changed files with 61 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
[e]
(util/stop e)
(state/set-editor-op! :undo)
(state/clear-editor-action!)
(editor/save-current-block!)
(let [{:keys [editor-cursor]} (undo-redo/undo)]
(restore-cursor! editor-cursor))
@@ -30,6 +31,7 @@
[e]
(util/stop e)
(state/set-editor-op! :redo)
(state/clear-editor-action!)
(let [{:keys [editor-cursor]} (undo-redo/redo)]
(restore-cursor! editor-cursor))
(state/set-editor-op! nil))