{"name":"react-remove-scroll","version":"2.5.6","description":"Disables scroll outside of `children` node.","main":"dist/es5/index.js","jsnext:main":"dist/es2015/index.js","module":"dist/es2015/index.js","types":"dist/es5/index.d.ts","module:es2019":"dist/es2019/index.js","scripts":{"dev":"lib-builder dev","test":"jest","test:ci":"jest --runInBand --coverage","build":"lib-builder build && yarn size:report","release":"yarn build && yarn test","size":"npx size-limit","size:report":"npx size-limit --json > .size.json","lint":"lib-builder lint","format":"lib-builder format","update":"lib-builder update","prepublish":"yarn build && yarn changelog","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s","changelog:rewrite":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","storybook":"start-storybook -p 6006"},"keywords":["scroll"],"author":{"name":"Anton Korzunov","email":"thekashey@gmail.com"},"license":"MIT","devDependencies":{"@types/react":"^18.0.0","@babel/core":"^7.17.9","@size-limit/preset-small-lib":"^2.1.6","@storybook/react":"^6.4.22","@theuiteam/lib-builder":"^0.1.4","@types/enzyme-adapter-react-16":"^1.0.6","babel-loader":"^8.2.4","enzyme-adapter-react-16":"^1.15.6"},"resolutions":{"@types/react":"^18.0.0","tslib":"^2.1.0"},"engines":{"node":">=10"},"peerDependencies":{"@types/react":"^16.8.0 || ^17.0.0 || ^18.0.0","react":"^16.8.0 || ^17.0.0 || ^18.0.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"repository":{"type":"git","url":"git+https://github.com/theKashey/react-remove-scroll.git"},"dependencies":{"react-remove-scroll-bar":"^2.3.4","react-style-singleton":"^2.2.1","tslib":"^2.1.0","use-callback-ref":"^1.3.0","use-sidecar":"^1.1.2"},"sideEffects":["**/sidecar.js"],"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx}":["prettier --write","eslint --fix","git add"],"*.{js,css,json,md}":["prettier --write","git add"]},"prettier":{"printWidth":120,"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true},"packageManager":"yarn@1.22.19","gitHead":"d493da9b23dff64fcf2a05ee50153502fc74aea0","bugs":{"url":"https://github.com/theKashey/react-remove-scroll/issues"},"homepage":"https://github.com/theKashey/react-remove-scroll#readme","_id":"react-remove-scroll@2.5.6","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==","shasum":"7510b8079e9c7eebe00e65a33daaa3aa29a10336","tarball":"http://registry-npm.ywwl.com/react-remove-scroll/download/react-remove-scroll-2.5.6.tgz","fileCount":68,"unpackedSize":76920,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDohOrBjL6QUE9lktTvORowC3yNY0AZXboafzUAzog5GAiBAwFFL/VgkcvSUVs+NdQ0gjzLSLf1xjpSGEBmSCo6OxA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTgUIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSuA//SGrmVltZxSVbPo88GsjsQ1dVrHdPzXlU6019foe9+sR6kCNC\r\neb1UWZRJC+yTqOTw6RbqA8fhG6ec2IQ9Pz9he5Hpe8XfdWMqAkzb3SnMdhh4\r\nwk/MFQO7PNhZ36n2GE58D5XYxkUqv/Mq6oPRHpSJN8+2bFtuQB+tr2fA/0rm\r\nRYHBqtLaS8HDBOpYutoII3QziEf5tccptgGLNGnkwtvQngJhoYpXUsRpZmQX\r\nNK/IRhHEB3NygEs0R5VKjUlBTq5MF3LWe78wlLXcKbWo7X9PtkWZ/vi76NGb\r\nuTrfUfqvYzBjbX3fgdU63wJunecv14HG9QkmBKvMfFU1Q+TRiSupSTMbMoki\r\nklHOe2351vtNImkBySJQAGBb67DhIiLPuzw4ySFdqhOPTDa+nCIsNE8rjPXt\r\nvsYLfDBS7s2aVGfdznDhrsmIW+myDajzmfjxAdHwppiMD/vAWXn9QnAFeu7N\r\naZIbJS0mqwzjQzy362P5rWTfQJSdo8Fv1m4DplE9NogDZLmWR6OCXB6FecsC\r\nZiiSa9129C6fIGDR2slgPDwmv9g9SG9v1IB1uF/xObQWCEeM+2YqUvx/v4lf\r\n334GiWrPczGOwAjAC2flmTQ/8J9ln66bgMxV+TE6GWUGNaWzEemXD7bHFhqG\r\nPjVqkK8q6qRim1aUstBFXAPwlAZXoNoIYE0=\r\n=Vv1K\r\n-----END PGP SIGNATURE-----\r\n","size":14267,"noattachment":false,"key":"/react-remove-scroll/-/react-remove-scroll-2.5.6.tgz"},"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"maintainers":[{"name":"kashey","email":"thekashey@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-remove-scroll_2.5.6_1682834696357_0.8147250222514555"},"_hasShrinkwrap":false,"readme":"<div align=\"center\">\n  <h1>React-remove-📜</h1>\n  <br/>\n   dont even scroll\n  <br/>\n  \n  <a href=\"https://www.npmjs.com/package/react-remove-scroll\">\n    <img src=\"https://img.shields.io/npm/v/react-remove-scroll.svg?style=flat-square\" />\n  </a>\n    \n  <a href=\"https://travis-ci.org/theKashey/react-remove-scroll\">\n   <img src=\"https://img.shields.io/travis/theKashey/react-remove-scroll.svg?style=flat-square\" alt=\"Build status\">\n  </a> \n\n  <a href=\"https://www.npmjs.com/package/react-remove-scroll\">\n   <img src=\"https://img.shields.io/npm/dm/react-remove-scroll.svg\" alt=\"npm downloads\">\n  </a> \n\n  <a href=\"https://bundlephobia.com/result?p=react-remove-scroll\">\n   <img src=\"https://img.shields.io/bundlephobia/minzip/react-remove-scroll.svg\" alt=\"bundle size\">\n  </a>   \n  <br/>\n</div>\n\nreact-remove-scroll\n====\n[![NPM version](https://img.shields.io/npm/v/react-remove-scroll.svg)](https://www.npmjs.com/package/react-remove-scroll)\n\nDisables scroll outside of `children` node.\n\n- 🖱 mouse and touch devices friendly\n- 📈 vertical and horizontal\n- 📜 removes document scroll bar maintaining it space\n- ✅ support nested scrollable elements\n- 🕳 supports react-portals (uses React Event system)\n- ☠️ it could block literally any scroll anywhere\n\n# Usage\nJust wrap content, which should be scrollable, and everything else would not. \n```js\nimport {RemoveScroll} from 'react-remove-scroll';\n\n<RemoveScroll>\n  Only this content would be scrollable\n</RemoveScroll>  \n```\n\n`RemoveScroll` accept following props\n- `children`\n- `[enabled]` - activate or deactivate component behaviour without removing it.\n- `[allowPinchZoom=false]` - enabled \"pinch-n-zoom\" behavior. By default it might be prevented. However - pinch and zoom might break \"scroll isolation\", and __disabled by default__.\n- `[noIsolation=false]` - disables outer event capturing. Event capturing is React friendly and unlikely be a problem.\nBut if you are using _shadowbox_ of some sort - you dont need it.\n- `[inert=false]` - ☠️(be careful) disables events the rest of page completely using `pointer-events` except the Lock(+shards). \nReact portals not friendly, might lead to production issues. Enable only for __rare__ cases, when you have to disable scrollbars somewhere on the page(except body, Lock and shards).  \n- `[forwardProps]` - will forward all props to the `children`\n- `[className]` - className for an internal div\n- `[removeScrollBar]` - to control scroll bar removal. Set to false, if you prefer to keep it (wheel and touch scroll is still disabled).\n\n# Size\n- (🧩 full) 1.7kb after compression (excluding tslib).\n---\n- (👁 UI) __400b__, visual elements only\n- (🚗 sidecar) 1.5kb, side effects\n```js\nimport {sidecar} from \"react-remove-scroll\";\nimport {RemoveScroll} from 'react-remove-scroll/UI';\n\nconst sidecar = sidecar(() => import('react-remove-scroll/sidecar'));\n\n<RemoveScroll sideCar={sidecar}>\n  Will load logic from a sidecar when needed\n</RemoveScroll>  \n```\n\n> Consider setting `-webkit-overflow-scrolling: touch;` on a document level for a proper mobile experience.\n\n## Internal div\nBut default RemoveScroll will create a div to handle and capture events.\nYou may specify `className` for it, if you need, or __remove it__.\n\nThe following code samples will produce the same output\n```js\n<RemoveScroll className=\"scroll\">\n  Only this content would be scrollable\n</RemoveScroll>\n```\n\n```js\n<RemoveScroll forwardProps>\n  <div className=\"scroll\"> //RemoveScroll will inject props to this div\n    Only this content would be scrollable\n  </div>\n</RemoveScroll> \n```\nPick the first one if you don't need a second.\n\n## Position:fixed elements\nTo properly size these elements please add a special className to them.\n```jsx\nimport {RemoveScroll} from 'react-remove-scroll';\n\n// to make \"width: 100%\"\n<div className={cx(classWithPositionFixed, RemoveScroll.classNames.fullWidth)} />\n\n// to make \"right:0\"\n<div className={cx(classWithPositionFixed, RemoveScroll.classNames.zeroRight)} />\n```\nSee [react-remove-scroll-bar](https://github.com/theKashey/react-remove-scroll-bar) documentation for details.\n\n## More than one lock\nWhen stacked more is active (default) only one (last) component would be active.\n\n## Over isolation\nThat could happen - \nyou disable scroll on the body, \nyou are suppressing all scroll and wheel events,\nand you are ghosting the rest of the page by the `inert` prop.\n\nOnly something inside Lock does exists for the browser, and that might be less than you expected.\n\nDont forget about `shard`, dont forget - `inert` is not portals friendly, dont forget - you dont need over isolation in most of the cases.\n\n> just be careful! \n\n# Performance\nTo do the job this library setup _non_ passive event listener. Chrome dev tools would complain about it, as a \nperformance no-op.\n\nWe have to use synchronous scroll/touch handler, and it may affect scrolling performance.\n\nConsider using `noIsolation` mode, if you have large scrollable areas.\n\n# Supported React versions\n- v1 supports React 15/16\n- v2 requires 16.8.0+ (hooks)\n\n# Scroll-Locky\nThis is a refactoring of another library - [react-scroll-locky](https://github.com/theKashey/react-scroll-locky) -\nto make package smaller and more react-portals friendly.\n\n## See also\n - [react-focus-on](https://github.com/theKashey/react-focus-on) - Finite Modal creator (uses Scroll-Locky) underneath.\n - [react-locky](https://github.com/theKashey/react-locky) - React event canceler\n - [react-scrolllock](https://github.com/jossmac/react-scrolllock) - React scroll lock\n - [scroll-lock](https://github.com/FL3NKEY/scroll-lock) - DOM scroll lock\n - [body-scroll-lock](https://github.com/willmcpo/body-scroll-lock) - DOM scroll lock\n \n > This package is relative smaller(1), more react friendly(2), works with non zero body margins(3), and has a better \"overscroll\" management. \n\n# License\nMIT","publish_time":1682834696592,"_cnpm_publish_time":1682834696592,"dist-tags":{"latest":"2.7.2"}}