Do not prevent input if first character is invalid
This commit is contained in:
parent
2ab9e4e85e
commit
7da40ce7fa
|
@ -118,6 +118,7 @@
|
||||||
auto-focus on-change-text on-change on-end-editing editable placeholder
|
auto-focus on-change-text on-change on-end-editing editable placeholder
|
||||||
placeholder-text-color auto-capitalize multiline number-of-lines]}
|
placeholder-text-color auto-capitalize multiline number-of-lines]}
|
||||||
(merge default-props (r/props component))
|
(merge default-props (r/props component))
|
||||||
|
valid-value (or valid-value "")
|
||||||
line-color (if error error-color line-color)
|
line-color (if error error-color line-color)
|
||||||
focus-line-color (if error error-color focus-line-color)
|
focus-line-color (if error error-color focus-line-color)
|
||||||
label-color (if (and error (not float-label?)) error-color label-color)
|
label-color (if (and error (not float-label?)) error-color label-color)
|
||||||
|
@ -164,7 +165,7 @@
|
||||||
(on-change-text text))
|
(on-change-text text))
|
||||||
(r/set-state component {:temp-value valid-value
|
(r/set-state component {:temp-value valid-value
|
||||||
:max-length (count valid-value)})))
|
:max-length (count valid-value)})))
|
||||||
:on-change #(on-change %)
|
:on-change on-change
|
||||||
:default-value value
|
:default-value value
|
||||||
:value temp-value
|
:value temp-value
|
||||||
:max-length max-length
|
:max-length max-length
|
||||||
|
|
Loading…
Reference in New Issue