-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(modal): add preventCloseOnClickOutside prop to Modal #6886
feat(modal): add preventCloseOnClickOutside prop to Modal #6886
Conversation
Sorry, I made typo in the commit message. |
Deploy preview for carbon-elements ready! Built with commit 0899785 |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit 0899785 https://deploy-preview-6886--carbon-components-react.netlify.app |
Deploy preview for carbon-elements ready! Built with commit 329be24 |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit 329be24 https://deploy-preview-6886--carbon-components-react.netlify.app |
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.
LGTM, thanks for adding that in! 👍 ✅
This is based on #6793 .
Changelog
New
preventCloseOnClickOutside
toModal
.Changed
handleMousedown
(Modal) to prevent closing when this prop is passed in and the click originates outside the modal itself.Testing / Reviewing
Enable the
preventCloseOnClickOutside
prop and try clicking outside of the modal. It should not close the modal. Ensure all variants ofModal
render properly and still close properly when the prop is not specified.(Yes, I copied a lot of text from the original PR 😄 .)