amis 1.9.1-beta.26 → 1.9.1-beta.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -990,7 +990,6 @@ export default class Form extends React.Component<FormProps, object> {
990
990
 
991
991
  if (Array.isArray(action.required) && action.required.length) {
992
992
  store.clearErrors(); // 如果是按钮指定了required,则校验前先清空一下遗留的校验报错
993
-
994
993
  const fields = action.required.map(item => ({
995
994
  name: item,
996
995
  rules: {isRequired: true}
@@ -1009,6 +1008,9 @@ export default class Form extends React.Component<FormProps, object> {
1009
1008
 
1010
1009
  /** 抛异常是为了在dialog中catch这个错误,避免弹窗直接关闭 */
1011
1010
  return Promise.reject(__('Form.validateFailed'));
1011
+ } else {
1012
+ /** 重置validated状态,保证submit时触发表单中的校验项 */
1013
+ store.clearErrors();
1012
1014
  }
1013
1015
  }
1014
1016
  if (