New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/remove-scroll

Package Overview
Dependencies
Maintainers
1
Versions
735
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/remove-scroll - npm Package Compare versions

Comparing version 0.0.0-dev-20220714012600 to 0.0.0-dev-20220714091855

LICENSE

4

dist/index.d.ts

@@ -1,1 +0,3 @@

export declare function preventBodyScroll(_document?: Document): () => void;
declare function preventBodyScroll(_document?: Document): (() => void) | undefined;
export { preventBodyScroll };

@@ -30,5 +30,4 @@ "use strict";

function getPlatform() {
var _a;
const agent = navigator.userAgentData;
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
return (agent == null ? void 0 : agent.platform) ?? navigator.platform;
}

@@ -73,5 +72,4 @@ var pt = (v) => isDom() && v.test(getPlatform());

function preventBodyScroll(_document) {
var _a;
const doc = _document != null ? _document : document;
const win = (_a = doc.defaultView) != null ? _a : window;
const doc = _document ?? document;
const win = doc.defaultView ?? window;
const { documentElement, body } = doc;

@@ -90,6 +88,5 @@ const locked = body.hasAttribute(LOCK_CLASSNAME);

const setIOSStyle = () => {
var _a2, _b;
const { scrollX, scrollY, visualViewport } = win;
const offsetLeft = (_a2 = visualViewport == null ? void 0 : visualViewport.offsetLeft) != null ? _a2 : 0;
const offsetTop = (_b = visualViewport == null ? void 0 : visualViewport.offsetTop) != null ? _b : 0;
const offsetLeft = (visualViewport == null ? void 0 : visualViewport.offsetLeft) ?? 0;
const offsetTop = (visualViewport == null ? void 0 : visualViewport.offsetTop) ?? 0;
const restoreStyle = assignStyle(body, {

@@ -114,1 +111,5 @@ position: "fixed",

}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
preventBodyScroll
});
{
"name": "@zag-js/remove-scroll",
"version": "0.0.0-dev-20220714012600",
"version": "0.0.0-dev-20220714091855",
"description": "JavaScript utility to remove scroll on body",

@@ -21,20 +21,20 @@ "keywords": [

],
"scripts": {
"build:fast": "yarn zag build",
"start": "yarn zag build --watch",
"build": "yarn zag build --prod",
"test": "jest --config ../../../jest.config.js --rootDir tests",
"lint": "eslint src --ext .ts,.tsx",
"test:ci": "yarn test --ci --runInBand --updateSnapshot",
"test:watch": "yarn test --watchAll"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@zag-js/dom-utils": "0.0.0-dev-20220714012600"
"devDependencies": {
"@zag-js/dom-utils": "0.0.0-dev-20220714091855"
},
"bugs": {
"url": "https://github.com/chakra-ui/zag/issues"
},
"scripts": {
"build-fast": "tsup src/index.ts --format=esm,cjs",
"start": "pnpm build --watch",
"build": "tsup src/index.ts --format=esm,cjs --dts",
"test": "jest --config ../../../jest.config.js --rootDir tests",
"lint": "eslint src --ext .ts,.tsx",
"test-ci": "pnpm test --ci --runInBand -u",
"test-watch": "pnpm test --watchAll"
}
}
}
# @zag-js/remove-scroll
## Installation

@@ -15,9 +13,6 @@

Yes please! See the
[contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md)
for details.
Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.
## Licence
This project is licensed under the terms of the
[MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc