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:
parent
13560bc866
commit
0f60f115f5
2 changed files with 11 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue