jossmac / react-scrolllock

🔒 Prevent scroll on the <body />
https://jossmac.github.io/react-scrolllock
MIT License
451 stars 43 forks source link

Modal remains freezed on iOS #26

Closed tharakabimal closed 6 years ago

tharakabimal commented 6 years ago
<div id="wrapper">
    <Header/>
    <div id="content">
       content here.......
       <div id="modal">
         scrollable modal content here....
       </div>   
    </div>
    {modalOpen &&
      <ScrollLock />
    }
    <Footer />
</div>

When the modal is open I want to disable body scroll for the content. But what happens is even the modal rmains locked only on iOS.

Here's a demo to get an idea about my usecase. https://github.com/tharakabimal/body-scroll-lock

Tested on an iPhone 5S, iOS version 11.3.1

andycanderson commented 6 years ago

are you passing in the ref to the scrollable area on the modal?

e.g. <ScrollLock touchScrollTarget={this.scrollArea} />

jossmac commented 6 years ago

@tharakabimal there's a description of the touchScrollTarget property in the readme https://github.com/jossmac/react-scrolllock#props

You can also checkout the example usage from the demo https://github.com/jossmac/react-scrolllock/blob/master/examples/src/index.js#L60


@andycanderson thank you for responding to this 🙂