fix: set the codemirror block as the edited block when it is clicked (#2299)

This commit is contained in:
Sebastian Bensusan
2021-06-28 00:58:13 -04:00
committed by GitHub
parent 1173d1ec34
commit a196ddb8ed

View File

@@ -155,9 +155,11 @@
(save-file-or-block-when-blur-or-esc! editor textarea config state))))
(.addEventListener element "mousedown"
(fn [e]
(state/clear-selection!)
(util/stop e)
(state/set-block-component-editing-mode! true)))
(let [block (into {} (db/get-block-by-uuid (:block/uuid config)))]
(state/clear-selection!)
(state/set-editing! id (.getValue editor) block nil false)
(util/stop e)
(state/set-block-component-editing-mode! true))))
(.save editor)
(.refresh editor)))
editor)))