forked from p96170835/amis
Select 在有已选项时,autoComplete 不显示已选项
This commit is contained in:
parent
aa98610ed0
commit
74cef48f13
|
@ -597,12 +597,12 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||||
|
|
||||||
let checkedAll = false;
|
let checkedAll = false;
|
||||||
let checkedPartial = false;
|
let checkedPartial = false;
|
||||||
let filtedOptions: Array<Option> =
|
let filtedOptions: Array<Option> = (inputValue && isOpen && !loadOptions
|
||||||
inputValue && isOpen && !loadOptions
|
? matchSorter(options, inputValue, {
|
||||||
? matchSorter(options, inputValue, {
|
keys: [labelField || 'label', valueField || 'value']
|
||||||
keys: [labelField || 'label', valueField || 'value']
|
})
|
||||||
})
|
: options.concat()
|
||||||
: options.concat();
|
).filter((option: Option) => !option.hidden && option.visible !== false);
|
||||||
|
|
||||||
const selectionValues = selection.map(select => select[valueField]);
|
const selectionValues = selection.map(select => select[valueField]);
|
||||||
if (multiple && checkAll) {
|
if (multiple && checkAll) {
|
||||||
|
|
|
@ -166,7 +166,10 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
||||||
if (
|
if (
|
||||||
!find(combinedOptions, (item: Option) => item.value == option.value)
|
!find(combinedOptions, (item: Option) => item.value == option.value)
|
||||||
) {
|
) {
|
||||||
combinedOptions.push(option);
|
combinedOptions.push({
|
||||||
|
...option,
|
||||||
|
hidden: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue