ReactJS: How to wrap react-select in redux-form field?

后端 未结 5 1077
难免孤独
难免孤独 2021-02-13 02:57

I am working on react-select library and facing some issues, I am using redux-form library and importing component from it

5条回答
  •  Happy的楠姐
    2021-02-13 03:19

    I had to call the onBlur without any argument. The issue with Hardik's answer was, it was not working in iPad (May be also in other iOS or touch devices. I was unable to check).

    The onBlur event is automatically triggered along with the onChange event in iPad. It caused the select value to reset to its initial value. So I had to call onBlur method like this,

    onBlur={(value) => input.onBlur()}

    const RenderSelectInput = ({input, options, name, id}) => (
        
                            
        
    提交评论

提交回复
热议问题