我正在使用 react-select 进行多选。我希望在删除包生成的关闭选项时阻止默认值。请参阅附加的打印屏幕http://i65.tinypic.com/23wlkhz.jpg `
function renderer(obj, index){
return <span name='name'>{obj.value}</span>
}
export default class Select extends Component {
componentDidMount(){
this.refs.stateSelect.focus();
}
render() {
const {props} = this;
const options = props.options;
return <Select
{...props}
allowCreate={true}
multi={true}
ref="stateSelect"
tabIndex={0}
autofocus
valueKey='value'
clearable={false}
value={props.value}
options={options}
valueRenderer = {renderer}
optionRenderer={renderer}
onChange={this.onChange}
/>;
}
onChange(value, selectedOptions){
this.props.onSelect && this.props.onSelect(selectedOptions);
}
}`