reagent-project / reagent-forms

Bootstrap form components for Reagent
339 stars 78 forks source link

:validator bug #142

Closed camachom closed 6 years ago

camachom commented 6 years ago

Hello! Thanks for maintaining this awesome library. I'm using 5.38, and experienced some unexpected behavior with :validator. It works great if you have a plain input like this:

[:input.form-control
     {:validator some-func
      :field :text
      :id id}]

However, if you're using class attribute, appending the new classes erases the old ones:

[:input.form-control
     {:class ["foo" "bar"]
      :validator some-func
      :field :text
      :id id}]

Anything in the vector ["foo" "bar"] will no longer show up, but form-control is still there. When I inspect the input, an object shows up: (#object[G__10589] "foo"). Let me know if you're able to reproduce the behavior.

yogthos commented 6 years ago

Thanks for the report, I just pushed out 0.5.39 with a fix. Let me know if it looks good to you.

camachom commented 6 years ago

seems to work just fine. Thanks!