diff --git a/components/calendar/__tests__/calendar-toolbar-phone.test.tsx b/components/calendar/__tests__/calendar-toolbar-phone.test.tsx index dc9171553..84f236ce6 100644 --- a/components/calendar/__tests__/calendar-toolbar-phone.test.tsx +++ b/components/calendar/__tests__/calendar-toolbar-phone.test.tsx @@ -42,3 +42,14 @@ describe('phone toolbar in the day view', () => { expect(screen.getByRole('button', { name: 'nav_open_menu' })).toBeInTheDocument(); }); }); + +// At 320px the month title was cut to one letter ("C…") beside the menu, the +// chevrons, Today and the header buttons. +describe('phone toolbar at 320px', () => { + it('gives the period title a line of its own below 25rem', () => { + renderToolbar({ viewMode: 'month' }); + const title = screen.getByText('Oct 2026'); + expect(title).toHaveClass('max-[25rem]:basis-full', 'max-[25rem]:order-first'); + expect(title.parentElement).toHaveClass('flex-wrap'); + }); +}); diff --git a/components/calendar/calendar-toolbar.tsx b/components/calendar/calendar-toolbar.tsx index 2fbc506ab..f67c49bb3 100644 --- a/components/calendar/calendar-toolbar.tsx +++ b/components/calendar/calendar-toolbar.tsx @@ -232,8 +232,10 @@ export function CalendarToolbar({
{mobileSearchField}
) : ( - /* Row 1: Back / Date nav / Today */ -
+ /* Row 1: Back / Date nav / Today. Below 400px (25rem, so a larger + text size counts too) the period title takes a line of its own + above the buttons: beside them it was cut to one letter. */ +
{/* The way back to the month takes the menu's place: both left the date no room. */} {onMenuClick && !onNavigateBack && ( @@ -251,7 +253,7 @@ export function CalendarToolbar({ )} {getDateLabel()}