Merge pull request #341 from 2betop/master

select multi 模式数据问题修复
This commit is contained in:
liaoxuezhi 2019-11-11 14:36:11 +08:00 committed by GitHub
commit ed699fb979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -668,7 +668,9 @@ export class Select extends React.Component<SelectProps, SelectState> {
<Checkbox
checked={checked}
trueValue={item.value}
onChange={() => this.handleChange(item)}
onChange={() => {
this.handleChange(item);
}}
>
{item.disabled
? item[labelField]
@ -758,7 +760,8 @@ export class Select extends React.Component<SelectProps, SelectState> {
spinnerClassName,
clearable,
labelField,
disabled
disabled,
checkAll
} = this.props;
const selection = this.state.selection;
@ -770,7 +773,12 @@ export class Select extends React.Component<SelectProps, SelectState> {
highlightedIndex={this.state.highlightedIndex}
isOpen={this.state.isOpen}
inputValue={inputValue}
onChange={this.handleChange}
onChange={
/*展示 Checkbox 的时候,会出发多次 onChange 原因待查*/ multiple ||
checkAll
? noop
: this.handleChange
}
onStateChange={this.handleStateChange}
// onOuterClick={this.close}
itemToString={item => (item ? item[labelField] : '')}

View File

@ -70,7 +70,7 @@ export function syncDataFromSuper(
// 如果是 form store则从父级同步 formItem 种东西。
if (store && store.storeType === 'FormStore') {
keys = uniq((store as IFormStore).items.map(item => item.name));
keys = uniq((store as IFormStore).items.map(item => `${item.name}`.replace(/\..*$/, '')));
force = false;
}