jossmac / react-scrolllock

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

Introduce the TouchScrollable component #35

Closed jossmac closed 5 years ago

jossmac commented 6 years ago

Simplify consumer implementation by removing the necessity for a touchScrollTarget prop that passes refs around. Used like:

import ScrollLock, { TouchScrollable } from 'react-scrolllock';

// lock children will be wrapped by TouchScrollable

<ScrollLock>
  <div style={{ height: 200, overflowY: 'auto' }}>{/* ... */}</div>
</ScrollLock>

// or, if you're app structure doesn't allow the above

<ScrollLock />
<TouchScrollable>
  <div style={{ height: 200, overflowY: 'auto' }}>{/* ... */}</div>
</TouchScrollable>

Also introduces a companion component, which is a thin wrapper around ScrollLock:

<ScrollLockToggle isActive={someProp} />
joeruello commented 5 years ago

We just ran into #33 as well, anything we can do to help get this merged?

theKashey commented 5 years ago

So - when?

jossmac commented 5 years ago

4.0.0 is available on npm