mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 06:11:39 +02:00
🎉 Autocomplete color fields
This commit is contained in:
parent
9e39e53488
commit
c16434e608
10 changed files with 177 additions and 37 deletions
|
@ -18,15 +18,18 @@
|
|||
(mf/defc numeric-input
|
||||
{::mf/wrap-props false
|
||||
::mf/forward-ref true}
|
||||
[props ref]
|
||||
[props external-ref]
|
||||
(let [value-str (obj/get props "value")
|
||||
min-val-str (obj/get props "min")
|
||||
max-val-str (obj/get props "max")
|
||||
wrap-value? (obj/get props "data-wrap")
|
||||
on-change (obj/get props "onChange")
|
||||
|
||||
;; We need a ref pointing to the input dom element, but the user
|
||||
;; of this component may provide one (that is forwarded here).
|
||||
;; So we use the external ref if provided, and the local one if not.
|
||||
local-ref (mf/use-ref)
|
||||
ref (or ref local-ref)
|
||||
ref (or external-ref local-ref)
|
||||
|
||||
value (d/parse-integer value-str)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue