Skip to content

Commit

Permalink
fix(antd/next): fix FormItem.label can not shown in void field
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Dec 8, 2021
1 parent 011d0ed commit f2bd220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/antd/src/form-item/index.tsx
Expand Up @@ -364,6 +364,8 @@ export const FormItem: ComposeFormItem = connect(
mapProps((props, field) => {
if (isVoidField(field))
return {
label: field.title || props.label,
asterisk: props.asterisk,
extra: props.extra || field.description,
}
if (!field) return props
Expand Down Expand Up @@ -396,7 +398,7 @@ export const FormItem: ComposeFormItem = connect(
return false
}
return {
label: field.title,
label: field.title || props.label,
feedbackStatus: takeFeedbackStatus(),
feedbackText: takeMessage(),
asterisk: takeAsterisk(),
Expand Down
4 changes: 3 additions & 1 deletion packages/next/src/form-item/index.tsx
Expand Up @@ -367,6 +367,8 @@ export const FormItem: ComposeFormItem = connect(
mapProps((props, field) => {
if (isVoidField(field))
return {
label: field.title || props.label,
asterisk: props.asterisk,
extra: props.extra || field.description,
}
if (!field) return props
Expand Down Expand Up @@ -399,7 +401,7 @@ export const FormItem: ComposeFormItem = connect(
return false
}
return {
label: field.title,
label: field.title || props.label,
feedbackStatus: takeFeedbackStatus(),
feedbackText: takeMessage(),
asterisk: takeAsterisk(),
Expand Down

0 comments on commit f2bd220

Please sign in to comment.