二货机器人
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
1 deletions
-
components/form/FormItem.tsx
-
components/form/__tests__/index.test.js
|
|
@ -169,7 +169,7 @@ function FormItem(props: FormItemProps): React.ReactElement { |
|
|
|
])} |
|
|
|
> |
|
|
|
{/* Label */} |
|
|
|
<FormItemLabel htmlFor={fieldId} {...props} required={isRequired} prefixCls={prefixCls} /> |
|
|
|
<FormItemLabel htmlFor={fieldId} required={isRequired} {...props} prefixCls={prefixCls} /> |
|
|
|
{/* Input Group */} |
|
|
|
<FormItemInput |
|
|
|
{...props} |
|
|
|
|
|
@ -417,4 +417,15 @@ describe('Form', () => { |
|
|
|
); |
|
|
|
expect(wrapper.find('.ant-form-item-explain').length).toBeTruthy(); |
|
|
|
}); |
|
|
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/21167
|
|
|
|
it('`require` without `name`', () => { |
|
|
|
const wrapper = mount( |
|
|
|
<Form.Item label="test" required> |
|
|
|
<input /> |
|
|
|
</Form.Item>, |
|
|
|
); |
|
|
|
|
|
|
|
expect(wrapper.find('.ant-form-item-required')).toHaveLength(1); |
|
|
|
}); |
|
|
|
}); |
|
|
|