mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🐛 Fix dirty text modifiers when changing pages
This commit is contained in:
parent
25ff15c62e
commit
d45bb0ace1
2 changed files with 12 additions and 1 deletions
|
@ -375,6 +375,15 @@
|
|||
(update [_ state]
|
||||
(update-in state [:workspace-text-modifier id] (fnil merge {}) props))))
|
||||
|
||||
(defn clean-text-modifier
|
||||
[id]
|
||||
(ptk/reify ::clean-text-modifier
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(->> (rx/of #(update % :workspace-text-modifier dissoc id))
|
||||
;; We delay a bit the change so there is no weird transition to the user
|
||||
(rx/delay 50)))))
|
||||
|
||||
(defn remove-text-modifier
|
||||
[id]
|
||||
(ptk/reify ::remove-text-modifier
|
||||
|
|
|
@ -68,7 +68,9 @@
|
|||
|
||||
;; Update the position-data of every text fragment
|
||||
(let [position-data (utp/calc-position-data node)]
|
||||
(st/emit! (dwt/update-position-data id position-data))))
|
||||
(st/emit! (dwt/update-position-data id position-data)))
|
||||
|
||||
(st/emit! (dwt/clean-text-modifier id)))
|
||||
|
||||
(defn- update-text-modifier
|
||||
[{:keys [grow-type id]} node]
|
||||
|
|
Loading…
Reference in a new issue