Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pickers] Fix role attribute #24621

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const DateRangePickerDay = React.forwardRef(function DateRangePickerDay<TDate>(
})}
>
<div
role="cell"
data-mui-test={shouldRenderPreview ? 'DateRangePreview' : undefined}
className={clsx(classes.rangeIntervalPreview, {
[classes.rangeIntervalDayPreview]: shouldRenderPreview,
Expand Down
5 changes: 3 additions & 2 deletions packages/material-ui-lab/src/DayPicker/PickersCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ function PickersCalendar<TDate>(props: PickersCalendarProps<TDate> & WithStyles<
const dayProps: PickersDayProps<TDate> = {
key: (day as any)?.toString(),
day,
role: 'cell',
isAnimating: isMonthSwitchingAnimating,
disabled: isDateDisabled(day),
allowKeyboardControl,
Expand All @@ -225,7 +224,9 @@ function PickersCalendar<TDate>(props: PickersCalendarProps<TDate> & WithStyles<
return renderDay ? (
renderDay(day, selectedDates, dayProps)
) : (
<PickersDay {...dayProps} />
<div role="cell" key={dayProps.key}>
<PickersDay {...dayProps} />
</div>
);
})}
</div>
Expand Down