You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this issue when I was working on my toy project.
Specifically, upgrading to the latest version of sablono (version 0.2.5) made it impossible to enter text into the "What needs to be done" input shown in the image below:
It seems like inputs are given a value attribute by default, and React then treats that input as a controlled component.
The problem for my app above was that adding a defaultValue attribute did not change my input into an uncontrolled component (as I wanted).
I think this behaviour was introduced in the following commit -- 8bcbef9
Maybe a possible fix would be to introduce an arity-4 version of sablono.core/input-field function, which allows specifying a defaultValue, and then using that defaultValue in place of value if present?
Any ideas on what could be the problem, and how best to go about fixing it?
Thanks.
The text was updated successfully, but these errors were encountered:
I'm pretty sure that's not the case with my code, since I can reproduce the same error by using Om 0.3.5, and then changing between sablono versions (0.2.3 works, but 0.2.4 and 0.2.5 don't).
sablono doesn't use om's wrap-form-element function, so the om version is irrelevant. I guess r0man has copied the function instead of relying on om's implementation to circumvent pulling in om as a dependency (#10 (comment)).
Thus it has to be fixed in both om (already fixed) and in sablono.
I noticed this issue when I was working on my toy project.
Specifically, upgrading to the latest version of sablono (version
0.2.5
) made it impossible to enter text into the"What needs to be done"
input shown in the image below:I'm running on the latest Mac OSX (10.9.1), with the project dependencies specified in this file -- https://github.com/TanYewWei/pedestal-om-todo/blob/master/project.clj
Everything works with sablono
0.2.3
and below.It seems like inputs are given a
value
attribute by default, and React then treats that input as a controlled component.The problem for my app above was that adding a
defaultValue
attribute did not change my input into an uncontrolled component (as I wanted).I think this behaviour was introduced in the following commit -- 8bcbef9
Maybe a possible fix would be to introduce an arity-4 version of
sablono.core/input-field
function, which allows specifying a defaultValue, and then using thatdefaultValue
in place ofvalue
if present?Any ideas on what could be the problem, and how best to go about fixing it?
Thanks.
The text was updated successfully, but these errors were encountered: