Merge pull request #516 from RickCole21/master

修复 Select 多选+autoComplete 时,重新拉取的问题
This commit is contained in:
liaoxuezhi 2020-04-01 12:40:06 +08:00 committed by GitHub
commit aa98610ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -453,9 +453,9 @@ export class Select extends React.Component<SelectProps, SelectState> {
}
handleStateChange(changes: any) {
const {multiple, checkAll} = this.props;
const {multiple, checkAll, loadOptions} = this.props;
let {inputValue} = this.state;
let update: any = {};
const loadOptions = this.props.loadOptions;
let doLoad = false;
switch (changes.type) {
@ -464,9 +464,10 @@ export class Select extends React.Component<SelectProps, SelectState> {
update = {
...update,
isOpen: multiple ? true : false,
isFocused: multiple && checkAll ? true : false
isFocused: multiple && checkAll ? true : false,
inputValue: !multiple ? '' : inputValue
};
doLoad = true;
doLoad = !multiple;
break;
case DownshiftChangeTypes.changeInput:
update.highlightedIndex = 0;