combo 关掉子 form 的 change 延时

This commit is contained in:
liaoxuezhi 2019-12-16 12:28:32 +08:00
parent 3e2e5e510c
commit 5c8e209047
2 changed files with 13 additions and 6 deletions

View File

@ -734,7 +734,8 @@ export default class ComboControl extends React.Component<ComboProps> {
wrapWithPanel: false,
mode: subFormMode,
className: cx(`Combo-form`, formClassName),
lazyChange: false
lazyChange: false,
formLazyChange: false
},
{
index,
@ -907,7 +908,8 @@ export default class ComboControl extends React.Component<ComboProps> {
wrapWithPanel: false,
mode: multiLine ? subFormMode : 'row',
className: cx(`Combo-form`, formClassName),
lazyChange: false
lazyChange: false,
formLazyChange: false
},
{
index,
@ -1043,7 +1045,8 @@ export default class ComboControl extends React.Component<ComboProps> {
wrapWithPanel: false,
mode: multiLine ? 'normal' : 'row',
className: cx(`Combo-form`, formClassName),
lazyChange: false
lazyChange: false,
formLazyChange: false
},
{
disabled: disabled,

View File

@ -102,6 +102,8 @@ export interface FormProps extends RendererProps, FormSchema {
saveFailed?: string;
validateFailed?: string;
};
lazyChange?: boolean;
formLazyChange?: boolean;
}
export default class Form extends React.Component<FormProps, object> {
@ -152,7 +154,8 @@ export default class Form extends React.Component<FormProps, object> {
'onFailed',
'onFinished',
'canAccessSuperData',
'lazyChange'
'lazyChange',
'formLazyChange'
];
hooks: {
@ -896,7 +899,8 @@ export default class Form extends React.Component<FormProps, object> {
disabled,
controlWidth,
resolveDefinitions,
lazyChange
lazyChange,
formLazyChange
} = props;
const subProps = {
@ -912,7 +916,7 @@ export default class Form extends React.Component<FormProps, object> {
disabled: disabled || (control as Schema).disabled || form.loading,
btnDisabled: form.loading || form.validating,
onAction: this.handleAction,
onChange: this.lazyHandleChange,
onChange: formLazyChange === false ? this.handleChange : this.lazyHandleChange,
addHook: this.addHook,
removeHook: this.removeHook,
renderFormItems: this.renderFormItems,