Skip to content

Commit

Permalink
fix: Form xs breakpoint (ant-design#44388)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ authored Aug 24, 2023
1 parent 9312b00 commit 3405450
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/form/style/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CSSObject } from '@ant-design/cssinjs';

import { resetComponent } from '../../style';
import { genCollapseMotion, zoomIn } from '../../style/motion';
import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal';
Expand Down Expand Up @@ -400,18 +401,22 @@ const makeVerticalLayoutLabel = (token: FormToken): CSSObject => ({
});

const makeVerticalLayout = (token: FormToken): CSSObject => {
const { componentCls, formItemCls } = token;
const { componentCls, formItemCls, rootPrefixCls } = token;

return {
[`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
[componentCls]: {
[formItemCls]: {
flexWrap: 'wrap',

[`${formItemCls}-label,
${formItemCls}-control`]: {
flex: '0 0 100%',
maxWidth: '100%',
[`${formItemCls}-label, ${formItemCls}-control`]: {
// When developer pass `xs: { span }`,
// It should follow the `xs` screen config
// ref: https://github.com/ant-design/ant-design/issues/44386
[`&:not([class*=" ${rootPrefixCls}-col-xs"])`]: {
flex: '0 0 100%',
maxWidth: '100%',
},
},
},
},
Expand Down

0 comments on commit 3405450

Please sign in to comment.