@zag-js/remove-scroll 0.76.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -2
- package/dist/index.mjs +8 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,10 +6,16 @@ var domQuery = require('@zag-js/dom-query');
|
|
|
6
6
|
var LOCK_CLASSNAME = "data-scroll-lock";
|
|
7
7
|
function assignStyle(el, style) {
|
|
8
8
|
if (!el) return;
|
|
9
|
-
const previousStyle =
|
|
9
|
+
const previousStyle = Object.keys(style).reduce(
|
|
10
|
+
(acc, key) => {
|
|
11
|
+
acc[key] = el.style.getPropertyValue(key);
|
|
12
|
+
return acc;
|
|
13
|
+
},
|
|
14
|
+
{}
|
|
15
|
+
);
|
|
10
16
|
Object.assign(el.style, style);
|
|
11
17
|
return () => {
|
|
12
|
-
el.style
|
|
18
|
+
Object.assign(el.style, previousStyle);
|
|
13
19
|
};
|
|
14
20
|
}
|
|
15
21
|
function setCSSProperty(el, property, value) {
|
package/dist/index.mjs
CHANGED
|
@@ -4,10 +4,16 @@ import { isIos } from '@zag-js/dom-query';
|
|
|
4
4
|
var LOCK_CLASSNAME = "data-scroll-lock";
|
|
5
5
|
function assignStyle(el, style) {
|
|
6
6
|
if (!el) return;
|
|
7
|
-
const previousStyle =
|
|
7
|
+
const previousStyle = Object.keys(style).reduce(
|
|
8
|
+
(acc, key) => {
|
|
9
|
+
acc[key] = el.style.getPropertyValue(key);
|
|
10
|
+
return acc;
|
|
11
|
+
},
|
|
12
|
+
{}
|
|
13
|
+
);
|
|
8
14
|
Object.assign(el.style, style);
|
|
9
15
|
return () => {
|
|
10
|
-
el.style
|
|
16
|
+
Object.assign(el.style, previousStyle);
|
|
11
17
|
};
|
|
12
18
|
}
|
|
13
19
|
function setCSSProperty(el, property, value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/remove-scroll",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"description": "JavaScript utility to remove scroll on body",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@zag-js/dom-query": "0.
|
|
22
|
+
"@zag-js/dom-query": "0.77.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"clean-package": "2.2.0"
|