Explorar el Código

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

fix #5824
Tienson Qin hace 3 años
padre
commit
92f2a2bba1
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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:"
             (ui/block-error "Block Render Error:"
                             {:content (:block/content block)
                             {:content (:block/content block)
                              :section-attrs
                              :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?))]
             (block-content config block edit-input-id block-id slide?))]
           [:div.flex.flex-row.items-center
           [:div.flex.flex-row.items-center
            (when (and (:embed? config)
            (when (and (:embed? config)