Prevent page scroll
npm install disable-scrolldisable scroll
===
   
Prevent page scrolling like a boss.
Supports scroll, wheel, touchmove, keydown events.
bash
npm install --save disable-scroll
`and import it
`typescript
import disableScroll from 'disable-scroll';
`Usage
`typescript
disableScroll.on(); // prevent scrolling
...
disableScroll.off(); // re-enable scroll
`> If you need to support legacy browsers you need to include the scrollingelement polyfill.
API
$3
Disable page scroll by adding event listeners and locking the scroll position.Options defaults to:
`typescript
{
authorizedInInputs: [32, 37, 38, 39, 40],
disableKeys: true,
disableScroll: true,
disableWheel: true,
keyboardKeys: [32, 33, 34, 35, 36, 37, 38, 39, 40],
}
``If you find a bug, please file an issue on our issue tracker on GitHub.
MIT
---
Inspired by jquery-disablescroll