Skip to content

Issue with stopPropagation #892

Open
@marcselman

Description

@marcselman

Summary:

When an element in a modal calls stopPropagation on the click event, it seems the first click on the overlay does not close the modal.

Steps to reproduce:

  1. Create a modal with onRequestClose
  2. Add a click handler to any element in the modal
  3. Call stopPropagation on the click event object
  4. Click on the overlay

Expected behavior:

The modal should close on the first click on the overlay.

Link to example of issue:

https://codepen.io/marcselman/pen/eYWrNML

Additional notes:

I'm using stopPropagation because I have some nested elements in the modal with multiple event handlers and I sometimes don't want the click event to bubble down to a lower element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions