@hashrytech/quick-components-kit 0.16.7 → 0.16.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hashrytech/quick-components-kit
2
2
 
3
+ ## 0.16.8
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: Fix for scroll jump after disable-scroll ends
8
+
3
9
  ## 0.16.7
4
10
 
5
11
  ### Patch Changes
@@ -23,12 +23,17 @@ export function disableScroll(node, enabled = true) {
23
23
  document.body.style.width = '100%';
24
24
  }
25
25
  function removeLock() {
26
+ const originalScrollBehavior = document.documentElement.style.scrollBehavior;
26
27
  document.body.style.position = originalBodyPosition;
27
28
  document.body.style.width = originalBodyWidth;
28
29
  document.body.style.top = originalTop;
29
30
  document.documentElement.style.overflowY = originalOverflow;
30
- // Instantly restore scroll position without animation
31
- window.scrollTo({ top: scrollTop, behavior: 'auto' });
31
+ document.documentElement.style.scrollBehavior = 'auto';
32
+ window.scrollTo(0, scrollTop);
33
+ // Restore scroll behavior without causing a jump
34
+ requestAnimationFrame(() => {
35
+ document.documentElement.style.scrollBehavior = originalScrollBehavior;
36
+ });
32
37
  }
33
38
  if (node && enabled)
34
39
  applyLock();
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hashrytech/quick-components-kit.git"
7
7
  },
8
- "version": "0.16.7",
8
+ "version": "0.16.8",
9
9
  "license": "MIT",
10
10
  "author": "Hashry Tech",
11
11
  "files": [