react-styled-flexboxgrid icon indicating copy to clipboard operation
react-styled-flexboxgrid copied to clipboard

outerMargin 0 cause scrolling on mobile

Open igoldny opened this issue 7 years ago • 3 comments

if you set outerMargin to 0 and resize the browser to mobile breakpoint it causes scrolling.

Steps to reproduce:

  1. enter: https://loicmahieu.github.io/react-styled-flexboxgrid/demo/index.html
  2. set outerMargin = 0
  3. resize browser

igoldny avatar Oct 31 '17 15:10 igoldny

To be more precise: You'll have horizontal scrolling if the outerMargin is less than half a gutterWidth.

I'm not sure if this is a bug or a feature, actually.

misund avatar Jun 14 '18 13:06 misund

definitely feature sounds useful :) anyways I use this workaround:

const styledRow = styled(Row)
  @media (max-width: ${media.sm}) {
    margin-left: 0;
    margin-right: 0;
  }
`;

const styledCol = styled(Col)`
  @media (max-width: ${media.sm}) {
    padding-right: 0;
    padding-left: 0;
  }
`;

igoldny avatar Jun 14 '18 13:06 igoldny

If @misund is right, we could calculate if the outerMargin is less than half a gutterWidth and in this case ?

LoicMahieu avatar Jun 18 '18 12:06 LoicMahieu