Skip to content

Commit

Permalink
[Masonry] Set width to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Oct 20, 2021
1 parent cd67243 commit 0d54459
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/mui-lab/src/Masonry/Masonry.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const validatePropValues = (base, prop) => {

export const getStyle = ({ ownerState, theme }) => {
let styles = {
width: '100%',
display: 'flex',
flexFlow: 'column wrap',
alignContent: 'space-between',
Expand Down
7 changes: 6 additions & 1 deletion packages/mui-lab/src/Masonry/Masonry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('<Masonry />', () => {
const columns = 4;
const spacing = 1;
const { getByTestId } = render(
<Masonry data-testid="container" sx={{ width: 500 }}>
<Masonry sx={{ minWidth: 1000 }} data-testid="container">
<div data-testid="child" style={{ height: 100 }} />
<div style={{ height: 50 }} />
<div style={{ height: 50 }} />
Expand All @@ -46,6 +46,7 @@ describe('<Masonry />', () => {
);
const columnHeight = 100 + parseToNumber(theme.spacing(spacing));
expect(getByTestId('container')).toHaveComputedStyle({
width: '100%',
display: 'flex',
flexFlow: 'column wrap',
alignContent: 'space-between',
Expand Down Expand Up @@ -75,6 +76,7 @@ describe('<Masonry />', () => {
theme,
}),
).to.deep.equal({
width: '100%',
display: 'flex',
flexFlow: 'column wrap',
alignContent: 'space-between',
Expand Down Expand Up @@ -102,6 +104,7 @@ describe('<Masonry />', () => {
theme,
}),
).to.deep.equal({
width: '100%',
display: 'flex',
flexFlow: 'column wrap',
alignContent: 'space-between',
Expand Down Expand Up @@ -150,6 +153,7 @@ describe('<Masonry />', () => {
theme,
}),
).to.deep.equal({
width: '100%',
display: 'flex',
flexFlow: 'column wrap',
alignContent: 'space-between',
Expand Down Expand Up @@ -195,6 +199,7 @@ describe('<Masonry />', () => {
theme,
}),
).to.deep.equal({
width: '100%',
display: 'flex',
flexFlow: 'column wrap',
alignContent: 'space-between',
Expand Down

0 comments on commit 0d54459

Please sign in to comment.