-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Use the new ownerState
object for the clock components and the desktop / mobile wrappers
#15669
base: master
Are you sure you want to change the base?
Conversation
…the desktop / mobile wrappers
Deploy preview: https://deploy-preview-15669--material-ui-x.netlify.app/ |
ownerState
object for the clock components and the desktop / mobile wrappers
const { ownerState: pickerOwnerState } = usePickerPrivateContext(); | ||
const ownerState: DigitalClockOwnerState = { | ||
...pickerOwnerState, | ||
hasDigitalClockAlreadyBeenRendered: !!containerRef.current, |
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.
I'm cleaning the name of this property to keep everything clearly scoped (like isPickerDisabled
vs disabled
).
/** | ||
* The current meridiem mode of the clock. | ||
*/ | ||
clockMeridiemMode: Meridiem | null; |
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.
Same, I'm correctly scoping isClockDisabled
to the clock to distinguish it from isPickerDisabled
@@ -370,7 +379,7 @@ export function Clock(inProps: ClockProps) { | |||
type={type} | |||
viewValue={viewValue} | |||
isInner={isPointerInner} | |||
hasSelected={hasSelected} | |||
isBetweenTwoClockValues={isPointerBetweenTwoClockValues} |
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.
The hasSelected
prop name was very unclear to be.
Since it's used in the ownerState
of ClockPointer
, I added a better name to it.
@@ -63,7 +89,7 @@ const ClockNumberRoot = styled('span', { | |||
}, | |||
variants: [ | |||
{ | |||
props: { inner: true }, | |||
props: { isClockNumberInInnerRing: true }, |
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.
Same, inner
was very unclear, I made the name more explicit.
@@ -340,10 +342,11 @@ export function PickersPopper(inProps: PickerPopperProps) { | |||
onDismiss, | |||
open, | |||
role, | |||
placement, | |||
placement = 'bottom', |
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.
I'm applying the default value here to make sure all the slots inside this file get a popperPlacement
property.
Part of #14475