Skip to content

Commit

Permalink
fix: form-item always take asterisk from props if provided (#13)
Browse files Browse the repository at this point in the history
alibaba/formily#3820

Co-authored-by: Zhang Cheng <chengzhang@natureself.cn>
  • Loading branch information
StephenPCG and Zhang Cheng committed May 15, 2023
1 parent 8af2afd commit 95179e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/form-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ export const FormItem: ComposeFormItem = Object.assign(
if (field.selfSuccesses.length) return split(field.selfSuccesses)
}
const takeAsterisk = () => {
if (field.required && field.pattern !== 'readPretty') {
return true
}
if ('asterisk' in props) {
return props.asterisk
}
if (field.required && field.pattern !== 'readPretty') {
return true
}
return false
}
return {
Expand Down

0 comments on commit 95179e8

Please sign in to comment.