Skip to content

Commit

Permalink
fix(antd/next): fix FormItem mapProps
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Dec 7, 2021
1 parent 2d98138 commit ccf1bc8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/antd/src/form-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ export const FormItem: ComposeFormItem = connect(
}
if (!field) return props
const takeFeedbackStatus = () => {
if (!field.selfModified) return
if (field.validating) return 'pending'
return field.decoratorProps.feedbackStatus || field.validateStatus
}
Expand All @@ -381,7 +380,7 @@ export const FormItem: ComposeFormItem = connect(
: buf.concat([text])
}, [])
}
if (field.validating || !field.selfModified) return
if (field.validating) return
if (props.feedbackText) return props.feedbackText
if (field.selfErrors.length) return split(field.selfErrors)
if (field.selfWarnings.length) return split(field.selfWarnings)
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/shared/internals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export const queryFeedbackMessages = (
field: Field,
search: ISearchFeedback
) => {
if (!field.feedbacks.length) return []
return queryFeedbacks(field, search).reduce(
(buf, info) => (isEmpty(info.messages) ? buf : buf.concat(info.messages)),
[]
Expand Down
3 changes: 1 addition & 2 deletions packages/next/src/form-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ export const FormItem: ComposeFormItem = connect(
}
if (!field) return props
const takeFeedbackStatus = () => {
if (!field.selfModified) return
if (field.validating) return 'pending'
return field.decoratorProps.feedbackStatus || field.validateStatus
}
Expand All @@ -384,7 +383,7 @@ export const FormItem: ComposeFormItem = connect(
: buf.concat([text])
}, [])
}
if (field.validating || !field.selfModified) return
if (field.validating) return
if (props.feedbackText) return props.feedbackText
if (field.selfErrors.length) return split(field.selfErrors)
if (field.selfWarnings.length) return split(field.selfWarnings)
Expand Down

0 comments on commit ccf1bc8

Please sign in to comment.