-
-
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
[docs] Fix modal transition demos #36137
[docs] Fix modal transition demos #36137
Conversation
2f77c73
to
e90363a
Compare
Netlify deploy previewhttps://deploy-preview-36137--material-ui.netlify.app/ Bundle size report |
e90363a
to
ef3e011
Compare
ef3e011
to
723eff8
Compare
@@ -65,11 +65,11 @@ function ChildModal() { | |||
<React.Fragment> | |||
<Button onClick={handleOpen}>Open Child Modal</Button> | |||
<Modal | |||
hideBackdrop |
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 UX is broken if we disable the backdrop.
I suspect this prop is here because we wanted to test that it was behaving correctly.
TransitionComponent = Fade, | ||
transitionDuration, |
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.
Sort props asc
invisible = false, | ||
open, | ||
slotProps = {}, | ||
slots = {}, | ||
transitionDuration, | ||
// eslint-disable-next-line react/prop-types |
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.
This is gone, we were missing the type for TransitionComponent
.
return typeof element === 'string'; | ||
} | ||
|
||
export default isHostComponent; |
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.
Convention
BackdropComponent={Backdrop} | ||
BackdropProps={{ |
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.
deprecated APIs
slots={{ backdrop: Backdrop }} | ||
slotProps={{ | ||
backdrop: { | ||
TransitionComponent: Fade, | ||
}, |
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 a consistent animation, use the Fade component for both the modal body and modal backdrop.
} | ||
}, | ||
}); | ||
|
||
return ( | ||
<animated.div ref={ref} style={style} {...other}> | ||
{children} | ||
{React.cloneElement(children, { onClick })} |
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 click needs to be registered on the element that is position fixed to work.
723eff8
to
3a91549
Compare
3a91549
to
8c44bcc
Compare
The two demos in https://mui.com/base/react-modal/#transitions have broken animations. It feels all off.
I noticed this in #36023.
https://deploy-preview-36137--material-ui.netlify.app/base/react-modal/#transitions