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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stack] Ensure that marginundefined doesn't occur in styling #33548

Merged
merged 7 commits into from
Jul 20, 2022

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented Jul 17, 2022

Closes #32196

Problem:

  • If direction prop receives a responsive value such that it doesn't start with the smallest breakpoint, such as direction={{ lg: 'row' }}, for the breakpoints below lg, "marginundefined": "0px"is being used in styling instead of "marginLeft": "0px" (for row direction) or "marginTop": "0px" (for column direction).
  • This function in line 86 results in undefined because directionValues[breakpoint] in the next line, line 87, is undefined.

Solution:

  • Ensure that this function in line 86 never results in undefined, by ensuring that directionValues[breakpoint] in the next line, line 87, is not undefined.

Codesandboxes:

@mui-bot
Copy link

mui-bot commented Jul 17, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 73cc0a6

@hbjORbj hbjORbj added bug 🐛 Something doesn't work package: material-ui Specific to @mui/material component: Stack The React component. labels Jul 17, 2022
@hbjORbj hbjORbj self-assigned this Jul 17, 2022
@hbjORbj hbjORbj requested a review from mnajdova July 19, 2022 10:16
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hbjORbj hbjORbj force-pushed the fix/stack-direction-prop branch from 7d49ca8 to f4d3d6f Compare July 19, 2022 15:52
@hbjORbj hbjORbj merged commit 21dbf22 into mui:master Jul 20, 2022
@hbjORbj hbjORbj mentioned this pull request Jul 20, 2022
1 task
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: Stack The React component. package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack] direction prop with array notation breaks spacing prop
3 participants