mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 08:29:42 -05:00
🐛 Fix problem with plugin edition text
This commit is contained in:
parent
a2df74be38
commit
d073f51790
1 changed files with 13 additions and 1 deletions
|
@ -27,7 +27,8 @@
|
||||||
[app.plugins.flex :as flex]
|
[app.plugins.flex :as flex]
|
||||||
[app.plugins.grid :as grid]
|
[app.plugins.grid :as grid]
|
||||||
[app.plugins.utils :as utils :refer [locate-objects locate-shape proxy->shape array-to-js]]
|
[app.plugins.utils :as utils :refer [locate-objects locate-shape proxy->shape array-to-js]]
|
||||||
[app.util.object :as obj]))
|
[app.util.object :as obj]
|
||||||
|
[app.util.text-editor :as ted]))
|
||||||
|
|
||||||
(declare shape-proxy)
|
(declare shape-proxy)
|
||||||
|
|
||||||
|
@ -451,6 +452,17 @@
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
|
;; The user is currently editing the text. We need to update the
|
||||||
|
;; editor as well
|
||||||
|
(when (contains? (:workspace-editor-state @st/state) id)
|
||||||
|
(let [shape (proxy->shape self)
|
||||||
|
editor
|
||||||
|
(-> shape
|
||||||
|
(txt/change-text value)
|
||||||
|
:content
|
||||||
|
ted/import-content
|
||||||
|
ted/create-editor-state)]
|
||||||
|
(st/emit! (dwt/update-editor-state shape editor))))
|
||||||
(st/emit! (dwc/update-shapes [id] #(txt/change-text % value)))))}
|
(st/emit! (dwc/update-shapes [id] #(txt/change-text % value)))))}
|
||||||
|
|
||||||
{:name "growType"
|
{:name "growType"
|
||||||
|
|
Loading…
Add table
Reference in a new issue