Repository navigation
[DateRangePicker] Fix disabled filler cells showing the range highlight - #23293
Conversation
Filler cells are hidden with `opacity: 0`, but the disabled styling of the selection variants (`opacity: 0.6`) has a higher specificity and won over it. A filler cell that was disabled and inside the selected range was rendered as a highlighted cell with no day number. Filler cells no longer receive any selection or preview owner state.
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
LukasTy
left a comment
There was a problem hiding this comment.
Nice fix, thanks for looking at it. 🙏
However, I'm not sure it's the best visual look, WDYT @noraleonte?
v8 looks
this PR
|
@noraleonte I think @LukasTy mentioned the rounded corners on the end/start of month 🤔 |
No, I was referring to the visual style of the disabled days (opacity) in the selected range. |
On a 2nd note, scratch that, looks like Angular MD does show a square for the last day in the month for ranges spanning multiple months... However, MD2 examples show the ending and starting days rounded off. Combining the 2 above cases, if we would like to not deviate too much from those behaviors, it means that we need to alter the visual disabled selected day behavior. What are your thoughts, @noraleonte? |






Fixes #23289
A filler cell (a day of the neighbouring month rendered to pad the grid) is hidden with
opacity: 0. The disabled styling of the selection variants (&.Mui-disabled { opacity: 0.6 }) is a compound selector, so it has a higher specificity and won over that rule. A filler cell that was both disabled (throughshouldDisableDate) and inside the selected range was therefore painted as a range-highlighted cell with no day number, leaving a visual gap in the row.Filler cells no longer receive any selection or preview owner state, which restores the behavior v8 had through
shouldRenderHighlight = isHighlighting && !outsideCurrentMonth. That guard was dropped in #21739 whenDateRangePickerDay2replacedDateRangePickerDay.Before
After