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

[docs] Fix modal transition demos #36137

Merged
merged 3 commits into from Feb 18, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Feb 12, 2023

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work docs Improvements or additions to the documentation component: modal This is the name of the generic UI component, not the React module! labels Feb 12, 2023
@mui-bot
Copy link

mui-bot commented Feb 12, 2023

Netlify deploy preview

https://deploy-preview-36137--material-ui.netlify.app/

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 8c44bcc

@oliviertassinari oliviertassinari changed the title Small fixes v14 [docs] Fix modal transition demos Feb 12, 2023
@@ -65,11 +65,11 @@ function ChildModal() {
<React.Fragment>
<Button onClick={handleOpen}>Open Child Modal</Button>
<Modal
hideBackdrop
Copy link
Member Author

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,
Copy link
Member Author

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
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 is gone, we were missing the type for TransitionComponent.

return typeof element === 'string';
}

export default isHostComponent;
Copy link
Member Author

Choose a reason for hiding this comment

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

Convention

Comment on lines -35 to -36
BackdropComponent={Backdrop}
BackdropProps={{
Copy link
Member Author

Choose a reason for hiding this comment

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

deprecated APIs

Comment on lines +67 to +80
slots={{ backdrop: Backdrop }}
slotProps={{
backdrop: {
TransitionComponent: Fade,
},
Copy link
Member Author

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 })}
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: modal This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants