Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Grid] Component spacing #31002

Closed
2 tasks done
brvndon-do opened this issue Feb 9, 2022 · 2 comments
Closed
2 tasks done

[Grid] Component spacing #31002

brvndon-do opened this issue Feb 9, 2022 · 2 comments
Labels
component: Grid The React component. duplicate This issue or pull request already exists

Comments

@brvndon-do
Copy link

brvndon-do commented Feb 9, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

Material UI v5's grid component spacing is only applying top and left padding as opposed to padding all around. This is a screenshot from v5's documentation on the Grid component.
v5_spacing

Expected behavior 馃

There was an expectation that when using the spacing prop on Grid container components, padding should be applied ALL around Grid item components. This is a screenshot from v4's documentation on the Grid component.
v4_spacing

Steps to reproduce 馃暪

Steps:

  1. Start a new project and install the latest version of Material UI (@mui/material)
  2. Import and render a Grid component with the spacing prop set to any number along with any Grid components with the item prop.
  3. Open the Chrome debugger (or any browser debugging) tool and inspect the newly created Grid component and its subsequent children with the item prop.
  4. Notice that the padding is applied to only the top and left.

Context 馃敠

Spacing should apply the padding to all directions of the component, not just the top and left.

Your environment 馃寧

`npx @mui/envinfo`
  Browser: Chrome
  System:
    OS: Windows 10 10.0.22000
  Binaries:
    Node: 16.6.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22000.120.0), Chromium (98.0.1108.43)
  npmPackages:
    @emotion/react: ^11.7.1 => 11.7.1 
    @emotion/styled: ^11.6.0 => 11.6.0 
    @mui/base:  5.0.0-alpha.64 
    @mui/icons-material: ^5.2.5 => 5.2.5 
    @mui/material: ^5.2.8 => 5.2.8 
    @mui/private-theming:  5.2.3 
    @mui/styled-engine:  5.2.6 
    @mui/styles: ^5.2.3 => 5.2.3 
    @mui/system:  5.2.8
    @mui/types:  7.1.0
    @mui/utils:  5.2.3
    @types/react: ^17.0.38 => 17.0.38
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2
    typescript: ^4.5.4 => 4.5.4
@brvndon-do brvndon-do added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 9, 2022
@danilo-leal danilo-leal changed the title Grid Component Spacing [Grid] Component spacing Feb 9, 2022
@danilo-leal danilo-leal added component: Grid The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 9, 2022
@danilo-leal
Copy link
Contributor

@mnajdova Any idea why that changed from v4 to v5? I resonate with the expectation of having padding on all sides and not only top and left.

@mnajdova
Copy link
Member

Duplicate of #29266

@mnajdova mnajdova marked this as a duplicate of #29266 Feb 10, 2022
@github-actions github-actions bot added the duplicate This issue or pull request already exists label Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Grid The React component. duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants