pradel / react-responsive-modal

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

v6 can't scroll on iOS #462

Closed pc035860 closed 3 years ago

pc035860 commented 3 years ago

Bug report

Describe the bug

I'm not able to scroll the modal content when the modal is opened in iOS Safari (or any webkit-based browsers on iOS).

To Reproduce

The "Modal with a lot of content" example on the doc site doesn't scroll for me.

https://react-responsive-modal.leopradel.com/#modal-with-a-lot-of-content

Expected behavior

It should scroll.

System information

Additional context

As far as I know, the issue is caused by incorrectly setting disableBodyScroll element. When using body-scroll-lock package on iOS, the ref element should be any ancestor of the scroll container.

I locally patch the refModal onto modal-container element and the issue is fixed.

pradel commented 3 years ago

@pc035860 thanks for reporting the issue, unfortunately I don't own any ios device. Do you think you could submit a pr with the fix please 🙏 ?