@zag-js/remove-scroll
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -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?.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?.offsetLeft ?? 0; | ||
const offsetTop = visualViewport?.offsetTop ?? 0; | ||
const restoreStyle = assignStyle(body, { | ||
@@ -96,0 +93,0 @@ position: "fixed", |
{ | ||
"name": "@zag-js/remove-scroll", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "JavaScript utility to remove scroll on body", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"clean-package": "2.2.0", | ||
"@zag-js/dom-utils": "0.2.2" | ||
"@zag-js/dom-utils": "0.2.4" | ||
}, | ||
@@ -26,0 +26,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
9430
193