Skip to content

Pressing esc key won't close the modal if the shouldCloseOnOverlayClick is set to false #186

@antonhalim

Description

@antonhalim

Summary:

It potentially might be a bug or just a question, I have a modal that the shouldCloseOnOverlayClick={false}, obviously clicking on overlay will not close the modal, but pressing on an esc key after that will not close the modal as well. But, opening a modal and pressing the esc key alone without clicking on overlay will close the modal as expected.

Steps to reproduce:

  1. Creates a new react-modal component.
  2. Set component option of shouldCloseOnOverlayClick={false}.
  3. Run server, open the modal, and clicking on the overlay layer.
  4. Press the esc button.

Expected behavior:

The modal should close.

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