Socket
Socket
Sign inDemoInstall

@zag-js/remove-scroll

Package Overview
Dependencies
Maintainers
1
Versions
717
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.1.6 to 0.2.0

13

dist/index.js

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

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

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

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

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

const setIOSStyle = () => {
var _a2, _b;
const { scrollX, scrollY, visualViewport } = win;
const offsetLeft = (visualViewport == null ? void 0 : visualViewport.offsetLeft) ?? 0;
const offsetTop = (visualViewport == null ? void 0 : visualViewport.offsetTop) ?? 0;
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 restoreStyle = assignStyle(body, {

@@ -93,0 +96,0 @@ position: "fixed",

{
"name": "@zag-js/remove-scroll",
"version": "0.1.6",
"version": "0.2.0",
"description": "JavaScript utility to remove scroll on body",

@@ -25,3 +25,3 @@ "main": "dist/index.js",

"devDependencies": {
"@zag-js/dom-utils": "0.1.13"
"@zag-js/dom-utils": "0.2.0"
},

@@ -28,0 +28,0 @@ "bugs": {

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