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 TimeClock meridiem button selected styles #16681

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/x-date-pickers/src/TimeClock/Clock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,18 @@ const ClockPin = styled('div', {
transform: 'translate(-50%, -50%)',
}));

const meridiemButtonCommonStyles = (theme: Theme, meridiemMode: Meridiem) => ({
const meridiemButtonCommonStyles = (
theme: Theme,
clockMeridiemMode: ClockOwnerState['clockMeridiemMode'],
) => ({
zIndex: 1,
bottom: 8,
paddingLeft: 4,
paddingRight: 4,
width: CLOCK_HOUR_WIDTH,
variants: [
{
props: { meridiemMode },
props: { clockMeridiemMode },
style: {
backgroundColor: (theme.vars || theme).palette.primary.main,
color: (theme.vars || theme).palette.primary.contrastText,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/src/TimeClock/ClockPointer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const ClockPointerThumb = styled('div', {
boxSizing: 'content-box',
variants: [
{
props: { isBetweenTwoClockValues: false },
props: { isClockPointerBetweenTwoValues: false },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one fixes the unwanted white dot on the selected hour thumb. 🙈
@siriwatknp Am I missing something or there is no way to infer variants props keys types? 🤔
These regressions are annoying and really hard to spot. 🙈

style: {
backgroundColor: (theme.vars || theme).palette.primary.main,
},
Expand Down