Thank you so much for this plugin. I'm facing an issue with this.
I have a form with different input fields. Select works as expected, but on changing of input field value, SELECT field values get cleared. What could be the reason? I'm having different onChange listeners for SELECT and INPUT.
Example code with issue is given below. I'm not sure how to create a JSFiddle with React Select. Sorry for that.
/* eslint react/prop-types: 0 */
import React from 'react';
import ReactDOM from 'react-dom';
import Select from 'react-select';
require('react-select/dist/react-select.min.css');
var options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' }
];
var Hello = React.createClass({
handleChange: function(date) {
this.setState({
startDate: date
});
},
render: function() {
return (
<div>
<input
className="form-control"
defaultValue=''
name="postal_code"
type="text"
onChange={this.handleChange} />
<Select
name="city"
options={options}
onChange={onSelectChange} />
</div>);
}
});
function onSelectChange(val) {
console.log("Selected: " + val);
}
ReactDOM.render(
<Hello />,
document.getElementById('userProfileDetails')
);
Thank you so much for this plugin. I'm facing an issue with this.
I have a form with different input fields. Select works as expected, but on changing of input field value, SELECT field values get cleared. What could be the reason? I'm having different onChange listeners for SELECT and INPUT.
Example code with issue is given below. I'm not sure how to create a JSFiddle with React Select. Sorry for that.