Closed pmacom closed 4 years ago
Can you confirm this issue still exists. If you override onChange
the value will not pass to formik but you can get it with e.target.value
.
<Field
required
name="gender"
label="Gender"
options={[
{ value: '', label: '-- No selection --' },
{ value: 'Male', label: 'Male' },
{ value: 'Female', label: 'Female' },
{ value: 'Other', label: 'Other' },
]}
component={Select}
onChange={(e) => {
console.log(e.target.value)
}}
/>
In
/sr/Select/Select.jsx
there is a missing 'name' prop on the Select field. This is giving a warning onChange and actually prevents the field from updating correctly. I'll provide a PR a little bit later that fixes it. I'm not sure if the same issue exists in the typescript file. I haven't looked. I'm not really a typescript person yet. I also noticed an issue related to the 'shrink' prop on the input label. It was acting funky, I believe I fixed that as well. Should I make a separate issue/PR for that issue?