-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[pickers] Fix transformOrigin
resolving based on popper placement
#18206
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 transformOrigin
resolving based on popper placement
#18206
Conversation
Deploy preview: https://deploy-preview-18206--material-ui-x.netlify.app/ Bundle size reportTotal Size Change: Show 14 more bundle changes@mui/x-date-pickers parsed: |
@@ -67,7 +67,7 @@ export interface PickerPopperSlotProps { | |||
/** | |||
* Props passed down to [Popper](https://mui.com/material-ui/api/popper/) component. | |||
*/ | |||
popper?: SlotComponentPropsFromProps<PopperProps, {}, PickerPopperOwnerState>; | |||
popper?: SlotComponentPropsFromProps<PopperProps, {}, PickerOwnerState>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have the final popperPlacement
value here, we would need to resolve the slotProps.popper
twice. 🙈
I opted for a slight BC by removing this field from the type to avoid inconsistencies or ugly and less performant code. 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not great but fine doing it :/
@@ -67,7 +67,7 @@ export interface PickerPopperSlotProps { | |||
/** | |||
* Props passed down to [Popper](https://mui.com/material-ui/api/popper/) component. | |||
*/ | |||
popper?: SlotComponentPropsFromProps<PopperProps, {}, PickerPopperOwnerState>; | |||
popper?: SlotComponentPropsFromProps<PopperProps, {}, PickerOwnerState>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not great but fine doing it :/
Fix the resolving of
transformOrigin
here:mui-x/packages/x-date-pickers/src/internals/components/PickerPopper/PickerPopper.tsx
Lines 117 to 120 in 6e70d48
ownerState
always included the initial value ofplacement
, regardless of the provided one.This lead to the following problem:
Before
Screen.Recording.2025-06-03.at.16.26.36.mov
After
Screen.Recording.2025-06-03.at.16.26.58.mov