Skip to content

Commit

Permalink
fix(layout): inset mode comflict with labelAlign top (#903)
Browse files Browse the repository at this point in the history
* feat: fix inset mode comflict with labelAlign top

* feat: add latest snapshot
  • Loading branch information
JohnIsOnTheRoad authored Jun 18, 2020
1 parent 246953a commit 9906a0c
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/zh-cn/schema-develop/mega-layout-antd.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ const App = () => {
grid
full
autoRow
labelAlign="top"
responsive={{ lg: 3, m: 2, s: 1 }}
>
<Field title="String" name="string"
Expand Down
1 change: 1 addition & 0 deletions docs/zh-cn/schema-develop/mega-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ const App = () => {
grid
full
autoRow
labelAlign="top"
responsive={{ lg: 3, m: 2, s: 1 }}
>
<Field title="String" name="string"
Expand Down
28 changes: 28 additions & 0 deletions packages/antd/src/__tests__/__snapshots__/layout.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ exports[`inset mode inset style 1`] = `
flex: initial;
}
.c0 .ant-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .ant-form-item.mega-layout-item {
padding-left: 0;
border: none;
Expand Down Expand Up @@ -342,6 +349,13 @@ exports[`inset mode inset style of component 1`] = `
flex: initial;
}
.c0 .ant-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .ant-form-item {
padding-left: 12px;
border: 1px solid #D8D8D8;
Expand Down Expand Up @@ -435,6 +449,13 @@ exports[`inset mode inset style(hasBorder) 1`] = `
flex: initial;
}
.c0 .ant-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .ant-form-item {
padding-left: 12px;
border: 1px solid #D8D8D8;
Expand All @@ -447,6 +468,13 @@ exports[`inset mode inset style(hasBorder) 1`] = `
`;

exports[`inset mode item inset style(hasBorder) 1`] = `
.c0 .ant-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .ant-form-item.mega-layout-item {
padding-left: 0;
border: none;
Expand Down
3 changes: 3 additions & 0 deletions packages/antd/src/components/FormMegaLayout/inset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const insetStyle = (props) => {
const result: any = {};

result.borderStyle = `
.ant-form-item {
display: flex;
}
${props.hasBorder ? `
.ant-form-item {
padding-left: 12px;
Expand Down
28 changes: 28 additions & 0 deletions packages/next/src/__tests__/__snapshots__/layout.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ exports[`inset mode inset style 1`] = `
border: none;
}
.c0 .next-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .next-form-item.mega-layout-item {
padding-left: 0;
border: none;
Expand Down Expand Up @@ -212,6 +219,13 @@ exports[`inset mode inset style of component 1`] = `
border: none;
}
.c0 .next-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .next-form-item {
padding-left: 12px;
border: 1px solid #D8D8D8;
Expand Down Expand Up @@ -255,6 +269,13 @@ exports[`inset mode inset style(hasBorder) 1`] = `
border: none;
}
.c0 .next-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .next-form-item {
padding-left: 12px;
border: 1px solid #D8D8D8;
Expand All @@ -267,6 +288,13 @@ exports[`inset mode inset style(hasBorder) 1`] = `
`;

exports[`inset mode item inset style(hasBorder) 1`] = `
.c0 .next-form-item {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.c0 .next-form-item.mega-layout-item {
padding-left: 0;
border: none;
Expand Down
3 changes: 3 additions & 0 deletions packages/next/src/components/FormMegaLayout/inset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const insetStyle = (props) => {


result.borderStyle = `
.next-form-item {
display: flex;
}
${props.hasBorder ? `
.next-form-item {
padding-left: 12px;
Expand Down

0 comments on commit 9906a0c

Please sign in to comment.