You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[grid] Direction class names use array indexes and ignore custom breakpoints #49901
The responsive array gives the classes MuiGrid-direction-0-column and MuiGrid-direction-1-row: the array index is used instead of the breakpoint name.
With custom breakpoints, a single value always gives MuiGrid-direction-xs-column, although the theme has no xs breakpoint.
The styles are correct; only the class names are wrong.
Expected behavior
MuiGrid-direction-xs-column and MuiGrid-direction-sm-row, like the object form { xs: 'column', sm: 'row' }.
MuiGrid-direction-mobile-column, like the size (MuiGrid-grid-mobile-2) and spacing classes, which use the theme's smallest breakpoint.
Context
direction is passed to generateDirectionClasses() in packages/mui-system/src/Grid/gridGenerator.ts as is. That function maps any object with Object.entries() (so an array gives its indexes) and hard-codes xs for a single value. size and offset go through parseResponsiveProp(), and generateSpacingClassNames() receives theme.breakpoints.keys[0], so their classes use the theme breakpoints.
Activity