Skip to content

Commit

Permalink
[pickers] Fix desktop date time Pickers grid layout (mui#12748)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy authored Apr 12, 2024
1 parent a3273e3 commit 786e334
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ const rendererInterceptor = function rendererInterceptor<
availableRangePositions: [rangePosition],
view: !isTimeViewActive ? popperView : 'day',
views: rendererProps.views.filter(isDatePickerView),
sx: [{ gridColumn: 1 }, ...finalProps.sx],
})}
<Divider orientation="vertical" />
<Divider orientation="vertical" sx={{ gridColumn: 2 }} />
<DateTimeRangePickerTimeWrapper
{...finalProps}
view={isTimeViewActive ? popperView : 'hours'}
Expand All @@ -106,6 +107,7 @@ const rendererInterceptor = function rendererInterceptor<
{}
>
}
sx={[{ gridColumn: 3 }, ...finalProps.sx]}
/>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,18 @@ const rendererInterceptor = function rendererInterceptor<
view: !isTimeViewActive ? popperView : 'day',
focusedView: focusedView && isDatePickerView(focusedView) ? focusedView : null,
views: rendererProps.views.filter(isDatePickerView),
sx: [{ gridColumn: 1 }, ...finalProps.sx],
})}
{timeViewsCount > 0 && (
<React.Fragment>
<Divider orientation="vertical" />
<Divider orientation="vertical" sx={{ gridColumn: 2 }} />
{inViewRenderers[isTimeViewActive ? popperView : 'hours']?.({
...finalProps,
view: isTimeViewActive ? popperView : 'hours',
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
openTo: isInternalTimeView(openTo) ? openTo : 'hours',
views: rendererProps.views.filter(isInternalTimeView),
sx: [{ gridColumn: 3 }, ...finalProps.sx],
})}
</React.Fragment>
)}
Expand Down

0 comments on commit 786e334

Please sign in to comment.