LaunchPadLab / lp-components

Our Components
http://lp-components.herokuapp.com
MIT License
5 stars 1 forks source link

Select without a placeholder does not add first value to redux #406

Closed chawes13 closed 4 years ago

chawes13 commented 4 years ago

This appears to be a redux-form issue (even in the latest v8.2.2) (see: https://codesandbox.io/s/redux-form-simple-example-bixo2). Given the state of that library, it might make sense for us to include a wrapped fix in our component?

dpikt commented 4 years ago

You know, it's embarrassing, I've been working with RF so long that I didn't realize this wasn't default HTML behavior. However in the context of redux-form I think it makes sense. Since all inputs are fully controlled, they should start with the value they're initialized with (empty string unless otherwise indicated). Other behavior could be achieved through initialValues or calling change manually when the field appears.

If you're satisfied with this explanation, this issue can be closed!