From 37442ae0d50b51b0b8c2d6317203617b3332ef5f Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 23 Nov 2021 13:15:06 +0800 Subject: [PATCH] fix: Form layout span 24 usage (#32981) close #32980 --- .../__tests__/__snapshots__/demo.test.js.snap | 131 ++++++++++++++++++ components/form/demo/col-24-debug.md | 65 +++++++++ components/form/style/horizontal.less | 3 + 3 files changed, 199 insertions(+) create mode 100644 components/form/demo/col-24-debug.md diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 682d335122..498e70f8d5 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -471,6 +471,137 @@ exports[`renders ./components/form/demo/basic.md correctly 1`] = ` `; +exports[`renders ./components/form/demo/col-24-debug.md correctly 1`] = ` +
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ + + + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+`; + exports[`renders ./components/form/demo/control-hooks.md correctly 1`] = `
{ + const onFinish = (values: any) => { + console.log('Success:', values); + }; + + const onFinishFailed = (errorInfo: any) => { + console.log('Failed:', errorInfo); + }; + + return ( + + + + + + + + + + + + +
+ ); +}; + +ReactDOM.render(, mountNode); +``` diff --git a/components/form/style/horizontal.less b/components/form/style/horizontal.less index d498a49db2..f8238982ae 100644 --- a/components/form/style/horizontal.less +++ b/components/form/style/horizontal.less @@ -9,6 +9,9 @@ } .@{form-item-prefix-cls}-control { flex: 1 1 0; + } + // https://github.com/ant-design/ant-design/issues/32980 + .@{form-item-prefix-cls}-control:not(.@{ant-prefix}-col) { // https://github.com/ant-design/ant-design/issues/32777 min-width: 0; }