-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Modal: Support configurable close behaviors #437
Comments
If I have to take a look at this, how do I go about? Can you please give me some pointers? |
Appreciate you separating this from the other Modal issue. I'd merge this PR as well. How about: <Modal closeOnClickOutside />
<Modal closeOnEscape /> Propose we default these to true as well. |
First, follow the CONTRIBUTING.md to get setup and understand the basics. Then, Modal.js handleHide = () => {
debug('handleHide()')
// Always remove all dimmer classes.
// If the dimmer value changes while the modal is open,
// then removing its current value could leave cruft classes previously added.
document.body.classList.remove('blurring', 'dimmable', 'dimmed', 'scrollable')
// == START PR == //
// wrap these in if conditionals based on the proposed props above
document.removeEventListener('keydown', this.handleDocumentKeyDown)
document.removeEventListener('click', this.handleClickOutside)
// == END PR == //
} See |
Also, only remove the body classes if the modal actually closed. |
Got it. Thx. |
Modal should support disabling hiding the modal when user clicks outside the modal. This is useful when we are dealing with complicated form and we don't want user to lose the work if they accidentally clicks outside the modal.
The text was updated successfully, but these errors were encountered: