mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
parent
2996d8e625
commit
2f6b367137
@ -249,6 +249,8 @@ export default class Form extends React.Component<FormProps, any> {
|
||||
'layout',
|
||||
'form',
|
||||
'hideRequiredMark',
|
||||
'wrapperCol',
|
||||
'labelCol',
|
||||
]);
|
||||
|
||||
return <form {...formProps} className={formClassName} />;
|
||||
|
@ -259,7 +259,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
|
||||
renderWrapper(prefixCls: string, children: React.ReactNode) {
|
||||
return (
|
||||
<FormContext.Consumer>
|
||||
<FormContext.Consumer key="wrapper">
|
||||
{({ wrapperCol: contextWrapperCol, vertical }: FormContextProps) => {
|
||||
const { wrapperCol } = this.props;
|
||||
const mergedWrapperCol: ColProps =
|
||||
@ -273,7 +273,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
// No pass FormContext since it's useless
|
||||
return (
|
||||
<FormContext.Provider value={{ vertical }}>
|
||||
<Col {...mergedWrapperCol} className={className} key="wrapper">
|
||||
<Col {...mergedWrapperCol} className={className}>
|
||||
{children}
|
||||
</Col>
|
||||
</FormContext.Provider>
|
||||
@ -328,7 +328,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
|
||||
renderLabel(prefixCls: string) {
|
||||
return (
|
||||
<FormContext.Consumer>
|
||||
<FormContext.Consumer key="label">
|
||||
{({ vertical, labelCol: contextLabelCol }: FormContextProps) => {
|
||||
const { label, labelCol, colon, id } = this.props;
|
||||
const required = this.isRequired();
|
||||
@ -350,7 +350,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
}
|
||||
|
||||
return label ? (
|
||||
<Col {...mergedLabelCol} className={labelColClassName} key="label">
|
||||
<Col {...mergedLabelCol} className={labelColClassName}>
|
||||
<label
|
||||
htmlFor={id || this.getId()}
|
||||
className={labelClassName}
|
||||
|
@ -481,8 +481,6 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
exports[`renders ./components/form/demo/coordinated.md correctly 1`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
labelcol="[object Object]"
|
||||
wrappercol="[object Object]"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
@ -1513,8 +1511,6 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = `
|
||||
exports[`renders ./components/form/demo/register.md correctly 1`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
labelcol="[object Object]"
|
||||
wrappercol="[object Object]"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
@ -2469,8 +2465,6 @@ exports[`renders ./components/form/demo/style-check-debug.md correctly 1`] = `
|
||||
exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
labelcol="[object Object]"
|
||||
wrappercol="[object Object]"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
@ -2889,8 +2883,6 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
labelcol="[object Object]"
|
||||
wrappercol="[object Object]"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
@ -4107,8 +4099,6 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
|
||||
exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
labelcol="[object Object]"
|
||||
wrappercol="[object Object]"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item ant-form-item-with-help"
|
||||
|
Loading…
Reference in New Issue
Block a user