Skip to content

Able to reopen modal if background is clicked during closing animation #19

@darrenklein

Description

@darrenklein

Hello - thanks for your hard work on this module.

I've found that, if I click the modal-backdrop during the modal's closing animation (during the 0.4 second transition), the modal will reopen, albeit with no content - just an empty modal.

I've worked out a solution and would like to open a pull request, with your permission. For everyone's benefit, I'll post the fix here:

Change line 81 of lib/Modal.js to read

if (e.target !== e.currentTarget || !backdrop || !_this.props.isOpen) {

and change line 62 of src/Modal.js to read

if (e.target !== e.currentTarget || !backdrop || !this.props.isOpen) {

Or just fork the master branch of my fork of this project (which includes Radium 16 fixes) from https://github.com/darrenklein/react-modal-bootstrap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions