Package Exports
- react-scroll-lock-component
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-scroll-lock-component) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-scroll-lock-component
A React component wrapper that restricts scrolling capabilities of everything except for its children
Demo
Check out the demo here!
Installation
npm install react-scroll-lock-component
Usage
import React, { Component } from 'react';
import ScrollLock from 'react-scroll-lock-component';
export default class extends Component {
render() {
return (
<div>
<ScrollLock> // when scrolling this div nothing else will scroll
<div>
...
</div>
</ScrollLock>
<div> // normal scrolling everywhere else
...
</div>s
</div>
);
}
}
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Credits
Adapted from this old mixin
License
MIT