Skip to content

Commit

Permalink
[@mantine/core] Grid: Fix incorrect responsive offsets handling (#2556)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Oct 5, 2022
1 parent e6943ff commit df2c042
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions src/mantine-core/src/Grid/Col/Col.tsx
Expand Up @@ -60,14 +60,7 @@ export interface ColProps extends DefaultProps, React.ComponentPropsWithoutRef<'
xl?: ColSpan;
}

const defaultProps: Partial<ColProps> = {
offset: 0,
offsetXs: 0,
offsetSm: 0,
offsetMd: 0,
offsetLg: 0,
offsetXl: 0,
};
const defaultProps: Partial<ColProps> = {};

function isValidSpan(span: ColSpan) {
if (span === 'auto' || span === 'content') {
Expand Down
8 changes: 4 additions & 4 deletions src/mantine-core/src/Grid/Grid.story.tsx
Expand Up @@ -19,11 +19,11 @@ export function UnexpectedRowBreak() {
export function Offset0() {
return (
<Grid>
<Grid.Col sx={{ backgroundColor: 'pink' }} span={3} offset={2} offsetSm={0}>
Column 1
<Grid.Col span={3} offsetMd={3}>
<div style={{ background: 'silver' }}>Column 1</div>
</Grid.Col>
<Grid.Col sx={{ backgroundColor: 'silver' }} span={7}>
Column 2
<Grid.Col span={6}>
<div style={{ background: 'pink' }}>Column 2</div>
</Grid.Col>
</Grid>
);
Expand Down

0 comments on commit df2c042

Please sign in to comment.