0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -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/use-callback
(mf/deps shape state) (mf/deps shape state)
(fn [event] (fn [event]
(dom/stop-propagation event) (let [is-empty? (ted/is-current-empty state)]
(dom/prevent-default event) (dom/stop-propagation event)
(st/emit! ::dwt/finalize-editor-state) (dom/prevent-default event)
(st/emit! (dwt/initialize-editor-state shape default-decorator)) (when (not is-empty?)
(reset! blurred true))) (st/emit! ::dwt/finalize-editor-state)
(st/emit! (dwt/initialize-editor-state shape default-decorator)))
(reset! blurred true))))
on-focus on-focus
(mf/use-callback (mf/use-callback

View file

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