@adamjanicki/ui 1.2.8 → 1.2.9

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.
@@ -2,7 +2,10 @@ import { useEffect } from "react";
2
2
  var lockScroll = function () {
3
3
  var scrollPosition = window.scrollY;
4
4
  var style = document.body.style;
5
+ var htmlStyle = document.documentElement.style;
5
6
  var overflow = style.overflow, position = style.position, top = style.top, width = style.width;
7
+ var scrollBehavior = htmlStyle.scrollBehavior;
8
+ htmlStyle.scrollBehavior = "auto";
6
9
  style.overflow = "hidden";
7
10
  style.position = "fixed";
8
11
  style.top = "-".concat(scrollPosition, "px");
@@ -12,7 +15,9 @@ var lockScroll = function () {
12
15
  style.position = position;
13
16
  style.top = top;
14
17
  style.width = width;
18
+ // Restore scroll position without smooth behavior
15
19
  window.scrollTo(0, scrollPosition);
20
+ htmlStyle.scrollBehavior = scrollBehavior;
16
21
  };
17
22
  };
18
23
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamjanicki/ui",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Basic UI components and hooks for React in TypeScript",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",