fix: calc result overlaps with input text when the latter is very long

close #4147
This commit is contained in:
Tienson Qin
2022-02-09 18:27:39 +08:00
parent f00bfb868f
commit 904c3a9114
3 changed files with 12 additions and 21 deletions

View File

@@ -294,13 +294,15 @@
(when-not (= mode "calc")
[:div.extensions__code-lang
(string/lower-case mode)]))
[:textarea (merge {:id id
;; Expose the textarea associated with the CodeMirror instance via
;; ref so that we can autofocus into the CodeMirror instance later.
:ref textarea-ref-name
:default-value code} attr)]
(when (= (:data-lang attr) "calc")
(calc/results (:calc-atom state)))])
[:div.flex.flex-1.flex-row
[:div.w-full
[:textarea (merge {:id id
;; Expose the textarea associated with the CodeMirror instance via
;; ref so that we can autofocus into the CodeMirror instance later.
:ref textarea-ref-name
:default-value code} attr)]]
(when (= (:data-lang attr) "calc")
(calc/results (:calc-atom state)))]])
;; Focus into the CodeMirror editor rather than the normal "raw" editor
(defmethod commands/handle-step :codemirror/focus [[_]]