mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 20:03:27 +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)
|
||||
(when on-blur
|
||||
(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
|
||||
(mf/use-fn
|
||||
|
@ -61,6 +66,7 @@
|
|||
:class (stl/css :input-with-values-editing)
|
||||
:default-value name
|
||||
:auto-focus true
|
||||
:on-focus on-focus
|
||||
:on-blur on-stop-edit
|
||||
:on-key-down handle-key-down}]]
|
||||
[:div {:class (stl/css :input-with-values-container :input-with-values-grid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue