mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
⚡ Replace duplicate on-blur lambda with stable on-text-blur ref
The inline (fn [] (ts/schedule ...)) passed as :on-blur to text-options was an exact copy of the on-text-blur callback already defined via mf/use-fn earlier in the same let block. Pass on-text-blur directly to avoid allocating a new function object on every render. Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
7751d9a69b
commit
81faa5a728
@ -500,13 +500,7 @@
|
|||||||
:values values
|
:values values
|
||||||
:on-change on-change
|
:on-change on-change
|
||||||
:show-recent true
|
:show-recent true
|
||||||
:on-blur
|
:on-blur on-text-blur}])
|
||||||
(fn []
|
|
||||||
(ts/schedule
|
|
||||||
100
|
|
||||||
(fn []
|
|
||||||
(when (not= "INPUT" (-> (dom/get-active) dom/get-tag-name))
|
|
||||||
(dom/focus! (txu/get-text-editor-content))))))}])
|
|
||||||
|
|
||||||
[:div {:class (stl/css :text-align-options)}
|
[:div {:class (stl/css :text-align-options)}
|
||||||
[:> text-align-options* common-props]
|
[:> text-align-options* common-props]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user