-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][Popover] Deprecate *Props and complete slots
, slotProps
#45035
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy previewPopover: parsed: +0.72% , gzip: +0.45% Bundle size reportDetails of bundle changes (Toolpad) |
@@ -63,6 +63,12 @@ describe('<Popover />', () => { | |||
<ReplacementPaper ref={ref} {...props} data-testid="custom" /> | |||
)), | |||
}, | |||
backdrop: { |
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.
backdrop: { | |
transition: { | |
expectedClassName: classes.transition, | |
testWithElement: null, | |
}, |
i think test for transition slot is missing
@@ -644,7 +644,7 @@ function testSlotPropsCallbackWithPropsAsOwnerState( | |||
const { queryByTestId } = await render( | |||
React.cloneElement(element, { slotProps, className: 'custom' }), | |||
); | |||
const slotComponent = queryByTestId('custom'); | |||
const slotComponent = queryByTestId('custom', { exact: false }); |
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.
Why is this required?
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.
For slots that are passed to inner component like the backdrop
, the className
from the ownerState
is concatenated with the outer component's className
, so the value is not exactly custom
.
The { exact: false }
still capture the custom
class but neglect other classes from the outer component.
Part of #41281
BackdropComponent
,BackdropProps
,PaperProps
,TransitionComponent
, andTransitionProps
.root
,paper
,transition
, andbackdrop
slots