pradel / react-responsive-modal

Simple responsive react modal
https://react-responsive-modal.leopradel.com/
MIT License
606 stars 95 forks source link

Window not scrollable after navigating routes #430

Closed matbrady closed 3 years ago

matbrady commented 3 years ago

Bug report

This issue has been reported before.

Describe the bug

When navigating to a new route from within a modal, the browser window is no longer able to be scrolled.

To Reproduce

On a page large enough to scroll, create a Modal containing a link to another route. Navigate to the new route. The new view will not be scrollable. The only way around it seems to be to create a setTimeout that navigates to the new route after the modal exit animation has finished.

Expected behavior

The html styles should be removed before the Modal is unmounted.

Example of issue

Stackblitz: https://stackblitz.com/edit/react-gzs6jw?file=src/Page1.js

System information

kuomingwu commented 3 years ago

same issue +1 and setTimeout is workaround !

pradel commented 3 years ago

@matbrady Thanks for reporting the issue, should be fixed in v5.2.1 :)