React-select: Select w/ redux-form : Field stays focused after being selected and value disappears onBlur

Created on 6 Dec 2016  路  2Comments  路  Source: JedWatson/react-select

Select w/ redux-form : Field stays focused after being selected and value disappears onBlur

let options = [
    { value: 'Denmark', label: 'Denmark' },
    { value: 'US', label: 'US' }
  ];

const renderDropdownList = ({ input, meta: { touched, error }, ...rest }) => (
  <div className='input-wrapper'>
    <Select {...input} {...rest}/>
    {touched && ((error && <span className='input-error'>{error}</span>))}
  </div>
)

<Field name="country" options={options} type="text" component={renderDropdownList} placeholder="Country"/>

Does anyone have a similar problem?

Most helpful comment

onBlur={null} helped

All 2 comments

set autoBlur flag to true maybe help you

onBlur={null} helped

Was this page helpful?
0 / 5 - 0 ratings