Merge pull request #134 from catchonme/master
select 可新增优化,未完全match也可新增
This commit is contained in:
commit
073aee2d79
|
@ -29,10 +29,6 @@ interface RadioProps extends OptionProps {
|
||||||
inline?: boolean;
|
inline?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onChange?: Function;
|
onChange?: Function;
|
||||||
autoFill?: {
|
|
||||||
[propName:string]: string
|
|
||||||
};
|
|
||||||
onBulkChange?: Function;
|
|
||||||
columnsCount: number;
|
columnsCount: number;
|
||||||
itemClassName?: string;
|
itemClassName?: string;
|
||||||
classPrefix: string;
|
classPrefix: string;
|
||||||
|
|
|
@ -483,17 +483,12 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
||||||
if (
|
if (
|
||||||
inputValue &&
|
inputValue &&
|
||||||
creatable &&
|
creatable &&
|
||||||
(!filtedOptions.length ||
|
!find(options, (item) => item[labelField || 'label'] == inputValue)
|
||||||
(isOpen &&
|
|
||||||
loadOptions &&
|
|
||||||
!matchSorter(options, inputValue, {
|
|
||||||
keys: [labelField || 'label', valueField || 'value'],
|
|
||||||
}).length))
|
|
||||||
) {
|
) {
|
||||||
filtedOptions.push({
|
filtedOptions.unshift({
|
||||||
[labelField]: inputValue,
|
[labelField]: inputValue,
|
||||||
[valueField]: inputValue,
|
[valueField]: inputValue,
|
||||||
isNew: true,
|
isNew: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -294,6 +294,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||||
files.splice(idx, 1, newFile);
|
files.splice(idx, 1, newFile);
|
||||||
this.current = null;
|
this.current = null;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
error: error ? error : null,
|
||||||
files: files
|
files: files
|
||||||
}, this.tick);
|
}, this.tick);
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue