Merge pull request #1155 from 2betop/fix

修复 select autocomplete 可能初始不请求的问题
This commit is contained in:
RickCole 2020-12-09 11:51:25 +08:00 committed by GitHub
commit 54b887347f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,11 +48,12 @@ export default class SelectControl extends React.Component<SelectProps, any> {
input: any;
unHook: Function;
lazyloadRemote: Function;
constructor(props: SelectProps) {
super(props);
this.changeValue = this.changeValue.bind(this);
this.loadRemote = debouce(this.loadRemote.bind(this), 250, {
this.lazyloadRemote = debouce(this.loadRemote.bind(this), 250, {
trailing: true,
leading: false
});
@ -242,7 +243,7 @@ export default class SelectControl extends React.Component<SelectProps, any> {
value={selectedOptions}
options={options}
loadOptions={
isEffectiveApi(autoComplete) ? this.loadRemote : undefined
isEffectiveApi(autoComplete) ? this.lazyloadRemote : undefined
}
creatable={creatable}
searchable={searchable || !!autoComplete}