Skip to content

Conversation

@sai6855
Copy link
Contributor

@sai6855 sai6855 commented Jan 6, 2026

closes #47563

According to https://mui.com/material-ui/react-grid/#column-direction, direction prop doesn't support column and column-reverse but api-docs page listed them as valid . This PR fixes discrepancy

preview: https://deploy-preview-47564--material-ui.netlify.app/material-ui/api/grid/

Copilot AI review requested due to automatic review settings January 6, 2026 06:49
@sai6855 sai6855 changed the title [grid] Remove 'column' and 'column-reverse' options from GridDirectio… [grid] Remove 'column' and 'column-reverse' options from GridDirection type Jan 6, 2026
@mui-bot
Copy link

mui-bot commented Jan 6, 2026

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against f7c8123

@sai6855 sai6855 added type: bug It doesn't behave as expected. docs Improvements or additions to the documentation. component: Grid The React component. labels Jan 6, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes 'column' and 'column-reverse' options from the GridDirection type definition, limiting it to only 'row' and 'row-reverse' values.

  • Changes the exported GridDirection type to exclude column-based flex-direction values
  • Represents a breaking change to the Grid component's TypeScript API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };

export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
export type GridDirection = 'row' | 'row-reverse';
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

This is a breaking API change that removes valid CSS flex-direction values ('column' and 'column-reverse') from the GridDirection type. This will cause TypeScript compilation errors for any existing code using these direction values. If this is intentional, it should be:

  1. Documented as a breaking change
  2. Include a migration guide explaining why these values are being removed and what alternatives users should use
  3. Consider deprecating these values first in a minor release before removing them in a major version

If there's a technical reason why column directions shouldn't be supported in Grid, that rationale should be documented.

Suggested change
export type GridDirection = 'row' | 'row-reverse';
export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';

Copilot uses AI. Check for mistakes.
type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };

export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
export type GridDirection = 'row' | 'row-reverse';
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The GridDirection type is being updated to remove 'column' and 'column-reverse' values, but this change is incomplete. Several other parts of the codebase still reference these values and need to be updated:

  1. PropTypes validation (lines 181-182 in this file) still accepts 'column' and 'column-reverse'
  2. The DIRECTIONS constant in gridClasses.ts (line 18) still includes all four values
  3. The underlying @mui/system/Grid/GridProps.ts still defines GridDirection with all four values
  4. PigmentGrid also has the full set of direction values

This incomplete change will cause inconsistencies between TypeScript type checking and runtime behavior, and may break applications that use column directions. Consider either completing all related changes together or reverting this change until a comprehensive update can be made.

Suggested change
export type GridDirection = 'row' | 'row-reverse';
export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';

Copilot uses AI. Check for mistakes.
@sai6855 sai6855 requested a review from siriwatknp January 6, 2026 09:57
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

@sai6855 As stated by Co-pilot in this comment, I think you need to remove from gridClasses and MUI System GridProps as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Grid The React component. docs Improvements or additions to the documentation. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs][grid] Incorrect direction prop description

3 participants