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
[DateRangePicker] Fix calendar day outside of month layout shifting on hover #6448
Conversation
These are the results for the performance tests:
|
diff --git a/packages/x-date-pickers/src/PickersDay/PickersDay.tsx b/packages/x-date-pickers/src/PickersDay/PickersDay.tsx
index ea562295f..9191d61f4 100644
--- a/packages/x-date-pickers/src/PickersDay/PickersDay.tsx
+++ b/packages/x-date-pickers/src/PickersDay/PickersDay.tsx
@@ -184,6 +184,7 @@ const PickersDayFiller = styled('div', {
...styleArg({ theme, ownerState }),
// visibility: 'hidden' does not work here as it hides the element from screen readers as well
opacity: 0,
+ pointerEvents: 'none',
})); The following also fixes the problem, if you don't want the |
Is it still a problem? |
I do not manage to reproduce it either. But Flavien's proposal makes sense even if the bug has been solved by an unknown commit. |
I can still reproduce it on |
I confirm I can reproduce it (and the PR solves the bug) with import * as React from 'react';
import { DateRangeCalendar } from '@mui/x-date-pickers-pro/DateRangeCalendar';
import { LocalizationProvider } from '@mui/x-date-pickers-pro'
import { AdapterDayjs } from '@mui/x-date-pickers-pro/AdapterDayjs'
export default function PlaygroundExample() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DateRangeCalendar />
</LocalizationProvider>
);
} Can not be done in codesandbox because |
Proposal for a PR title change: |
When moving to the slot, the DateRangeDay is adding styles to empty grid cells which leads to some inconsistencies
Here is a record of the problem when moving the mouse hover the cell
hoverBug.mp4
The reason is that on hover the cell adds a 1px border. We do not see it because component are hidden, but it modifies the layout