0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

🐛 Fix focus list for texts

This commit is contained in:
Alejandro Alonso 2023-07-14 14:10:26 +02:00 committed by Alonso Torres
parent 13560bc866
commit 0f60f115f5
2 changed files with 11 additions and 5 deletions

View file

@ -131,11 +131,13 @@
(mf/use-callback
(mf/deps shape state)
(fn [event]
(dom/stop-propagation event)
(dom/prevent-default event)
(st/emit! ::dwt/finalize-editor-state)
(st/emit! (dwt/initialize-editor-state shape default-decorator))
(reset! blurred true)))
(let [is-empty? (ted/is-current-empty state)]
(dom/stop-propagation event)
(dom/prevent-default event)
(when (not is-empty?)
(st/emit! ::dwt/finalize-editor-state)
(st/emit! (dwt/initialize-editor-state shape default-decorator)))
(reset! blurred true))))
on-focus
(mf/use-callback

View file

@ -73,6 +73,10 @@
(let [block (impl/getCurrentBlock state)]
(get-editor-block-data block)))
(defn is-current-empty
[state]
(impl/isCurrentEmpty state))
(defn get-editor-current-inline-styles
[state]
(if (impl/isCurrentEmpty state)