Skip to content

[scheduler] Remove unused --has-scroll CSS variable from DayTimeGrid#22799

Merged
rita-codes merged 2 commits into
mui:masterfrom
Anexus5919:fix/scheduler-daytimegrid-unused-has-scroll-var
Jun 12, 2026
Merged

[scheduler] Remove unused --has-scroll CSS variable from DayTimeGrid#22799
rita-codes merged 2 commits into
mui:masterfrom
Anexus5919:fix/scheduler-daytimegrid-unused-has-scroll-var

Conversation

@Anexus5919

Copy link
Copy Markdown
Contributor

Closes #22783

Summary

DayTimeGridContainer declared a --has-scroll CSS custom property that nothing reads. The real scroll state is driven by the data-has-scroll attribute, set from the React hasScroll state and consumed by the [data-has-scroll] selectors in the same file. The variable was also hardcoded to a static 1, so it would not reflect the actual state even if something did read it. This removes the dead declaration.

Change

A single line removed from the DayTimeGridContainer styled block:

})(({ theme }) => ({
  '--fixed-cell-width': `${FIXED_CELL_WIDTH}px`,
  '--hour-height': `${HOUR_HEIGHT}px`,

- '--has-scroll': 1,

  width: '100%',
  height: '100%',

Why this is safe

  • A repo-wide search for var(--has-scroll) returns no consumers. The only --has-scroll reference was the declaration itself.
  • The unrelated --has-scroll-x variable in the premium timeline (EventTimelinePremiumContent.tsx) is a different property and is not touched.
  • The data-has-scroll attribute path (lines 79, 82, 102, 175, 179, 428, 453) is unchanged, so there is no behavior change.

Testing

No new test was added. The variable is never read so there is no observable behavior to assert, and a test checking that a CSS variable is absent would not reflect how this repo validates changes. Verification instead:

  • pnpm --filter "@mui/x-scheduler" run typescript passes.
  • pnpm eslint passes.
  • pnpm test:unit --project "x-scheduler" --run passes (18 files, 168 tests), including the existing data-has-scroll tests in WeekView.test.tsx, which behave identically.
  • Post-change grep confirms --has-scroll no longer appears anywhere in the repo.

Changelog

@mui/x-scheduler

  • Remove an unused --has-scroll CSS variable from DayTimeGrid.

Checklist

  • I have followed (at least) the PR section of the contributing guide.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22799--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Anexus5919

Copy link
Copy Markdown
Contributor Author

@rita-codes @zannager Kindly have a review on this pr. Thanks!

@rita-codes rita-codes changed the title [scheduler] Remove unused --has-scroll CSS variable from DayTimeGrid [scheduler] Remove unused --has-scroll CSS variable from DayTimeGrid Jun 12, 2026
@rita-codes rita-codes added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: scheduler Changes related to the scheduler. labels Jun 12, 2026

@rita-codes rita-codes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks! 🙇‍♀️

@rita-codes
rita-codes merged commit b9133c6 into mui:master Jun 12, 2026
25 of 26 checks passed
mbrookes pushed a commit to mbrookes/mui-x that referenced this pull request Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: scheduler Changes related to the scheduler. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scheduler] DayTimeGrid sets an unused --has-scroll CSS variable

2 participants