mirror of
https://github.com/penpot/penpot.git
synced 2025-07-29 23:37:25 +02:00
✨ Add text selection on focus of an input-with-values (#5909)
This commit is contained in:
parent
a3e74c55f1
commit
195127b099
1 changed files with 6 additions and 0 deletions
|
@ -44,6 +44,11 @@
|
||||||
(reset! editing* false)
|
(reset! editing* false)
|
||||||
(when on-blur
|
(when on-blur
|
||||||
(on-blur new-name)))))
|
(on-blur new-name)))))
|
||||||
|
on-focus
|
||||||
|
(mf/use-fn
|
||||||
|
(fn [event]
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(dom/select-text! (dom/get-target event))))
|
||||||
|
|
||||||
handle-key-down
|
handle-key-down
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
@ -61,6 +66,7 @@
|
||||||
:class (stl/css :input-with-values-editing)
|
:class (stl/css :input-with-values-editing)
|
||||||
:default-value name
|
:default-value name
|
||||||
:auto-focus true
|
:auto-focus true
|
||||||
|
:on-focus on-focus
|
||||||
:on-blur on-stop-edit
|
:on-blur on-stop-edit
|
||||||
:on-key-down handle-key-down}]]
|
:on-key-down handle-key-down}]]
|
||||||
[:div {:class (stl/css :input-with-values-container :input-with-values-grid)
|
[:div {:class (stl/css :input-with-values-container :input-with-values-grid)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue