Reputation: 3159
I am using antd V4 and antd Select is not binding with redux-form. I can bind the data and can select the items.But After selected the items, move to next control or click, all selected items are disappeared.
I am trying to write my own custom wrapping, still the same issue.
I found out that v3 and v4 onChange event is as follow -:
V3.x onChange?: (value: T, option: React.ReactElement | React.ReactElement[]) => void;
V4.x onChange?: (value: ValueType, option: OptionsType[number] | OptionsType) => void;
enter link description here Anyone using antd V4.x with redux-form-antd?
Regards,
Alex
Upvotes: 1
Views: 474
Reputation: 1425
I faced the same issue with the redux-form and found a solution from this GitHub issue
worked solution for me is add this onBlur={e => { e.preventDefault(); }}
in to redux field
Upvotes: 0
Reputation: 3159
onBlur in v3 return value is a bad design since user can not prevent event bubble like preventDefault or stopPropagation. In v4, it returns the origin event instead.
we pass onBlur={() => { input.onBlur(input.value); }} prop to Select component for now
Upvotes: 1