Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal does not work with dynamically set closeOnEsc prop #504

Open
neefrehman opened this issue Nov 7, 2022 · 0 comments
Open

Modal does not work with dynamically set closeOnEsc prop #504

neefrehman opened this issue Nov 7, 2022 · 0 comments
Labels

Comments

@neefrehman
Copy link

neefrehman commented Nov 7, 2022

Bug report

Describe the bug

I'm working on a modal implementation where, if an error is encountered, the user can no longer exit the modal via clicking on the overlay or by pressing escape. They should instead follow the subsequent instructions shown in the modal. When doing this, I noticed that the closeOnEsc behaviour wasn't taking effect, whereas closeOnOverlayClick worked fine with the same prop value of !isError.

To Reproduce

A minimal repro sandbox can be found here

Expected behaviour

The modal should not be able to close when the closeOnEsc prop gets dynamically set to false due to a react state update.

System information

  • Version of react-responsive-modal: 6.2.0
  • Version of react: 18.2.0
  • Browser version: all current browsers
@neefrehman neefrehman added the bug label Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant