Răsfoiți Sursa

fix mock text disordered (#10862)

megayu 1 an în urmă
părinte
comite
574f3be7a0
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/main/frontend/components/editor.cljs

+ 1 - 1
src/main/frontend/components/editor.cljs

@@ -645,7 +645,7 @@
    (let [content (str content "0")
          graphemes (util/split-graphemes content)
          graphemes-char-index (reductions #(+ %1 (count %2)) 0 graphemes)]
-     (for [[idx c] (zipmap graphemes-char-index graphemes)]
+     (for [[idx c] (into (sorted-map) (zipmap graphemes-char-index graphemes))]
        (if (= c "\n")
          [:span {:id (str "mock-text_" idx)
                  :key idx} "0" [:br]]