@zag-js/remove-scroll
Advanced tools
Comparing version 0.1.6 to 0.2.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9657
199