select 可新增优化,未完全match也可新增

This commit is contained in:
catchonme 2019-08-01 16:52:23 +08:00
parent 21c3b0acc9
commit e70c408b7f
4 changed files with 5 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{
"name": "amis",
"version": "1.0.0-rc.9",
"version": "1.0.0-beta.94",
"description": "一种MIS页面生成工具",
"main": "lib/index.js",
"scripts": {

View File

@ -29,10 +29,6 @@ interface RadioProps extends OptionProps {
inline?: boolean;
disabled?: boolean;
onChange?: Function;
autoFill?: {
[propName:string]: string
};
onBulkChange?: Function;
columnsCount: number;
itemClassName?: string;
classPrefix: string;

View File

@ -483,17 +483,12 @@ export class Select extends React.Component<SelectProps, SelectState> {
if (
inputValue &&
creatable &&
(!filtedOptions.length ||
(isOpen &&
loadOptions &&
!matchSorter(options, inputValue, {
keys: [labelField || 'label', valueField || 'value'],
}).length))
!find(options, (item) => item[labelField || 'label'] == inputValue)
) {
filtedOptions.push({
filtedOptions.unshift({
[labelField]: inputValue,
[valueField]: inputValue,
isNew: true,
isNew: true
});
}

View File

@ -294,6 +294,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
files.splice(idx, 1, newFile);
this.current = null;
this.setState({
error: error ? error : null,
files: files
}, this.tick);
}));