Skip to content

If 2 or more modals are open and one is closed, ReactModal__Body--open class is erroneously removed #231

Closed
@ameyms

Description

@ameyms

Summary:

If two or more modals are open and one is closed, ReactModal__Body--open class is erroneously removed from body element

Steps to reproduce:

  1. Open a modal M1
  2. Open a second modal M2
  3. Close M2. The class ReactModal__Body--open will no longer exist on body element.

Expected behavior:

The class ReactModal__Body--open should be active on the body element as long as there is at least one instance of modal open

Additional notes:

Perhaps we need to keep track of the total number of open modal instances?

elementClass(document.body).remove('ReactModal__Body--open');
},
renderPortal: function(props) {
if (props.isOpen) {
elementClass(document.body).add('ReactModal__Body--open');
} else {
elementClass(document.body).remove('ReactModal__Body--open');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions