[docs] Fix date range calendar demo after MUI X v9 update by LukasTy · Pull Request #48262 · mui/material-ui (original) (raw)
MUI X v9 replaced the multi-element DateRangePickerDay with a single ButtonBase, removing .MuiDateRangePickerDay-day and .MuiPickerDay-root classes. Update selectors to use v9 CSS variables and class names.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
changed the title
Fix date range picker demo CSS selectors for MUI X v9 [docs] Fix date range picker demo CSS selectors for MUI X v9
LukasTy changed the title
[docs] Fix date range picker demo CSS selectors for MUI X v9 [docs] Fix date range calendar demo after MUI X v9 update
- Increase --PickerDay-size to 32px (accounts for v8 wrapper padding)
- Replace .MuiTypography-subtitle1 with .MuiPickersCalendarHeader-labelContainer (v9 uses body1, not subtitle1)
- Replace .MuiTypography-caption with .MuiDayCalendar-weekDayLabel and align width with day size
- Override .MuiDayCalendar-root minWidth (v9 defaults to 312px)
- Remove redundant lineHeight and margin overrides
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
PickersRangeCalendarHeader uses PickersArrowSwitcher which renders a Typography variant="subtitle1" for the month label — the original selector was correct.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
dayjs is immutable — .date() and .add() return new instances. The old code discarded the return values, so both startDate and endDate resolved to today, collapsing the range to a single date.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
LukasTy marked this pull request as ready for review
Add a regression test fixture for StaticDateRangePicker to catch styling regressions after MUI X major upgrades. Uses pinned dates for deterministic screenshots.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Include the existing XDateRangeDemo from docs/src in the regression test import glob instead of creating a separate fixture, avoiding code duplication. Add required MUI X dependencies to the test workspace.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
The docs demo import broke in CI. Use a standalone fixture with pinned dates instead.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
A standalone fixture doesn't add enough value. Revert the test workspace dependency additions as well.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
LukasTy deleted the claude/vigilant-goldwasser branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})