浏览代码

fix: CTRL+X will wipe out block content when render errored

fix #5824
Tienson Qin 3 年之前
父节点
当前提交
92f2a2bba1
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/main/frontend/components/block.cljs

+ 4 - 1
src/main/frontend/components/block.cljs

@@ -2169,7 +2169,10 @@
             (ui/block-error "Block Render Error:"
                             {:content (:block/content block)
                              :section-attrs
-                             {:on-click #(state/set-editing! edit-input-id (:block/content block) block "")}})
+                             {:on-click #(do
+                                           (editor-handler/clear-selection!)
+                                           (editor-handler/unhighlight-blocks!)
+                                           (state/set-editing! edit-input-id (:block/content block) block ""))}})
             (block-content config block edit-input-id block-id slide?))]
           [:div.flex.flex-row.items-center
            (when (and (:embed? config)