react-select上的OnChange事件将清除其他字段的值

时间:2017-02-02 15:56:02

标签: redux-form react-select

从ReactSelect中选择或更改选项后 电子邮件字段(实际上,所有其他字段都将被清除)

怎么回事?

Form.jsx

                    <Field
                        name="email"
                        component="input"
                        type="email"
                        placeholder="Email"
                    />
                    <Field
                        name="selectedTable"
                        value={selectedTable}
                        tableList={this.props.tableList}
                        selectTableChange={this.props.selectTable}
                        component={TableNameSelect}
                    />

ReactSelect.jsx

        import * as React from 'react'
        import {connect} from 'react-redux'
        import {Field} from 'redux-form'
        import * as ReactSelect from 'react-select';

       <ReactSelect
                            {...input}
                            value={input.value}
                            options={tableListOptions}
                            placeholder="Select Table..."
                            onChange={(option:any)=>{
                                selectTableChange(option.value)
                                input.onChange(option)
                            }}
                            onBlur={
                                (e:any) => {
                                input.onBlur(input.value)
                                console.log(this.props)
                                }
                            }

                        />                        

0 个答案:

没有答案