Select search 功能优化

This commit is contained in:
liaoxuezhi 2019-11-11 19:31:56 +08:00
parent 7366e877f7
commit 4302ce2325
1 changed files with 2 additions and 4 deletions

View File

@ -343,8 +343,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
onBlur(e: any) { onBlur(e: any) {
this.setState({ this.setState({
isFocused: false, isFocused: false
inputValue: ''
}); });
this.props.onBlur && this.props.onBlur(e); this.props.onBlur && this.props.onBlur(e);
@ -440,7 +439,6 @@ export class Select extends React.Component<SelectProps, SelectState> {
case DownshiftChangeTypes.clickItem: case DownshiftChangeTypes.clickItem:
update = { update = {
...update, ...update,
inputValue: '',
isOpen: multiple ? true : false, isOpen: multiple ? true : false,
isFocused: multiple && checkAll ? true : false isFocused: multiple && checkAll ? true : false
}; };
@ -632,7 +630,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
return ( return (
<div <div
{...getItemProps({ {...getItemProps({
key: index, key: item.value || index,
index, index,
item, item,
disabled: item.disabled disabled: item.disabled