{"_id":"@alminde/react-scrolllock","_rev":"1-65a52e722cdf40092caf9a28c8376e17","name":"@alminde/react-scrolllock","dist-tags":{"latest":"4.0.2"},"versions":{"4.0.2":{"name":"@alminde/react-scrolllock","description":"Prevent scroll on the body when component is mounted.","version":"4.0.2","main":"dist/index.js","license":"MIT","scripts":{"test":"jest","lint":"eslint .","start":"webpack-dev-server --mode development","build":"babel src -d dist --copy-files","prepublishOnly":"npm run build","build:examples":"webpack --mode production","deploy:examples":"gh-pages -d examples/dist","publish:examples":"npm run build:examples && npm run deploy:examples","precommit":"flow check && lint-staged"},"jest":{"setupFiles":["<rootDir>/config/setupPolyfills.js"],"setupTestFrameworkScriptFile":"<rootDir>/config/setupFramework.js"},"repository":{"type":"git","url":"git+https://github.com/jossmac/react-scrolllock.git"},"author":{"name":"Joss Mackison","url":"https://github.com/jossmac"},"bugs":{"url":"https://github.com/jossmac/react-scrolllock/issues"},"homepage":"https://jossmac.github.io/react-scrolllock","keywords":["react","scroll","scroll-lock","disable-scroll"],"dependencies":{"exenv":"^1.2.2","react-node-resolver":"^2.0.1"},"peerDependencies":{"react":"^16.3.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-eslint":"^9.0.0","babel-loader":"^7.1.4","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-flow":"^6.23.0","babel-preset-react":"^6.24.1","css-loader":"^0.28.11","enzyme":"^3.2.0","enzyme-adapter-react-16":"^1.1.0","eslint":"^5.4.0","eslint-plugin-react":"^7.11.1","flow-bin":"^0.61.0","gh-pages":"^1.1.0","glam":"^5.0.1","html-webpack-plugin":"^3.2.0","jest":"^21.2.1","jest-cli":"^21.2.1","prop-types":"^15.6.0","raf":"^3.4.0","react":"^16.3.2","react-dom":"^16.3.2","react-prop-toggle":"^1.0.2","style-loader":"^0.21.0","webpack":"^4.5.0","webpack-cli":"^2.0.14","webpack-dev-server":"^3.1.3"},"lint-staged":{"*.js":"eslint"},"gitHead":"b7a74eb425a18011f014aeb39ad7eef3ea46057a","_id":"@alminde/react-scrolllock@4.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.15.1","_npmUser":{"name":"alminde","email":"jalminde@me.com"},"dist":{"integrity":"sha512-XlcU6i8a9z87FOwPVrp1Lt7AHKufwaUY4LQ/aKprGi31cy81+j5EX8LvFh1OwrA416bu5AAXlYtxxdcWMbnvng==","shasum":"feef9ebe1c80e383325a44a23dca9023b946c12a","tarball":"https://registry.npmjs.org/@alminde/react-scrolllock/-/react-scrolllock-4.0.2.tgz","fileCount":14,"unpackedSize":319085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnwQgCRA9TVsSAnZWagAA/uMP/A9Y+qRc37f4lthJrpcI\nIkwYvHor8oZ3reIl9GEhYTM0s1gY5sfyUDxxSsI/6kTrvG8BbKMaetM8ouMW\nx9PBLNqr5WEu1qUszHLeg6O39akeMTi65SIjQILOKNadrAYO5f8vohhlXRlN\nW1eSPQMFO9mrYE2oBgr45J0kFrOIbbAuv0kJkDnAX4GEzk1xaYdccHiQjyGa\na9chSlocdXBHjRA3g+awMTqfeSi0Es5ODWBzu5JqjHlmSuiOsdbCgfjv0KFL\ncYTn1CNO+eqrTHwVm0dlcZJrTaPEr86TlvycRtFv1MLcYR3YSTqVVK8LvvXx\nJ8wnHF5QsudwRykBHyxjzsoj13/vYfgGDtb4NOl4ReHbRKUPLOZNLMUuSKtP\nP2EOlJitxQUYjHZ8lcGuqpPJe9RCQu5TRs1W/WwVvBBdHZYK5a0hiWHwcYUx\nQTlU7z/CmLgOuNyoqc9dMRvnYuRe0xa7xhASQD8+JWILIakp/wzBkfzR3Yjw\nr8SQ8iFABNggCNXKZxJxY6NBVBIPCIWk7gFa6xknv6yV2ItCkdY8aLDaOMfy\nOmSsQ1HIsqYG4NzQ2yP2cOzxR9qAStpRaX5Bnb/esGQldKcxmmjc2LkKEzMW\nU+nO+h3qFYrwyOfrli3NCvjhc7S0TVlpjEmaLdMKscCCbYme7XBC8btEX966\n/pQb\r\n=pFbX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSvG+vrHcONQf6HrsDNq8pd1RArSRRjo5StIZWCN7I6wIhAKAmRbZfyMLlziA8jp/L+W+MgFLK+ICz/IFk5FmfeLly"}]},"maintainers":[{"name":"alminde","email":"jalminde@me.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-scrolllock_4.0.2_1553925152197_0.9888951850014822"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-30T05:52:31.996Z","4.0.2":"2019-03-30T05:52:32.452Z","modified":"2022-04-04T13:36:37.952Z"},"maintainers":[{"name":"alminde","email":"jalminde@me.com"}],"description":"Prevent scroll on the body when component is mounted.","homepage":"https://jossmac.github.io/react-scrolllock","keywords":["react","scroll","scroll-lock","disable-scroll"],"repository":{"type":"git","url":"git+https://github.com/jossmac/react-scrolllock.git"},"author":{"name":"Joss Mackison","url":"https://github.com/jossmac"},"bugs":{"url":"https://github.com/jossmac/react-scrolllock/issues"},"license":"MIT","readme":"# React Scroll Lock\n\nPrevent scroll on the `<body />` when a component is mounted.\n\n## Install\n\n```bash\nyarn add react-scrolllock\n```\n\n## Usage\n\n```js\nimport ScrollLock, { TouchScrollable } from 'react-scrolllock';\n\nclass Modal extends Component {\n  state = { lockScroll: false }\n  render() {\n    return (\n      <div>\n        ...\n        // the lock accepts a single child element, which supports touch-scrolling.\n        <ScrollLock>\n          <ElementWithScrollableContent>...</ElementWithScrollableContent>\n        </ScrollLock>\n\n        // if your app structure doesn't allow wrapping like above, the `TouchScrollable`\n        // component is exposed as a named export.\n        <ScrollLock />\n        <TouchScrollable>\n          <ElementWithScrollableContent>...</ElementWithScrollableContent>\n        </TouchScrollable>\n        \n        // you can also toggle the lock based on some state.\n        <ScrollLock isActive={this.state.lockScroll} />\n      </div>\n    );\n  }\n}\n```\n\n## Props\n\n#### ScrollLock\n\n| Property                       | Description                                                                    |\n| :----------------------------- | :----------------------------------------------------------------------------- |\n| accountForScrollbars `boolean` | Default: `true` -- Whether or not to replace the scrollbar width when active. |\n| isActive `boolean` | Default: `true` -- Whether or not the lock is active. |\n| children `element` | Default: `null` -- This element is wrapped internally by the TouchScrollable component. |\n\n#### TouchScrollable\n\nWrap an element in the `TouchScrollable` component if you need an area that supports scroll on mobile.\n\nThis is necessary because the `touchmove` event is explicitly cancelled &mdash; iOS doesn't observe `overflow: hidden;` when applied to the `<body />` element 😢\n\n| Property                 | Description                                    |\n| :----------------------- | :--------------------------------------------- |\n| children `element` | **Required** The element that can be scrolled. |\n","readmeFilename":"README.md"}