Skip to content

Attach clickHandler on backdrop element instead of document #137

@ajainarayanan

Description

@ajainarayanan

Issue description

Bumped onto a scenario where I need to show one Modal on top of another one and on click on second Modal(anywhere) the first Modal gets closed.

The reason for this is the Modal component attaches the click event to document instead of backdrop element.

  • version #3.1.0
  • components: Modal

Steps to reproduce issue

  • Open a Modal
  • Have a button in the Modal that will open Another Modal
  • Click anywhere in the Second Modal (opened on top of the first one).

CodePen: http://codepen.io/anon/pen/amdaGw

Note:

In my case the first Modal gets closed and the second Modal becomes un-responsive. However I couldn't reproduce this in codepen.

EDIT: Removed an error screenshot. Could be based on my usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions