From 2caf68fcdf62a8400927b21203207a6bf887edb4 Mon Sep 17 00:00:00 2001 From: Katie McFaul Date: Thu, 30 Apr 2026 10:01:12 -0400 Subject: [PATCH] feat(CalendarMonth): add select prop passthrough --- .../src/components/CalendarMonth/CalendarMonth.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-core/src/components/CalendarMonth/CalendarMonth.tsx b/packages/react-core/src/components/CalendarMonth/CalendarMonth.tsx index 2cd53c36fb9..707d7adf00d 100644 --- a/packages/react-core/src/components/CalendarMonth/CalendarMonth.tsx +++ b/packages/react-core/src/components/CalendarMonth/CalendarMonth.tsx @@ -1,7 +1,7 @@ import { useEffect, useMemo, useRef, useState } from 'react'; import { TextInput } from '../TextInput'; import { Button } from '../Button'; -import { Select, SelectList, SelectOption } from '../Select'; +import { Select, SelectList, SelectOption, SelectProps } from '../Select'; import { MenuToggle, MenuToggleElement } from '../MenuToggle'; import { InputGroup, InputGroupItem } from '../InputGroup'; import RhMicronsCaretLeftIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-left-icon'; @@ -81,6 +81,8 @@ export interface CalendarProps extends CalendarFormat, Omit void; /** Functions that returns if a date is valid and selectable. */ validators?: ((date: Date) => boolean)[]; + /** Additional props passed to the month select component. */ + monthSelectProps?: SelectProps; } const buildCalendar = (year: number, month: number, weekStart: number, validators: ((date: Date) => boolean)[]) => { @@ -143,6 +145,7 @@ export const CalendarMonth = ({ cellAriaLabel, isDateFocused = false, inlineProps, + monthSelectProps, ...props }: CalendarProps) => { const longMonths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] @@ -328,6 +331,7 @@ export const CalendarMonth = ({ }} selected={monthFormatted} popperProps={{ appendTo: 'inline' }} + {...monthSelectProps} > {longMonths.map((longMonth, index) => (