kitzo 2.1.14 → 2.1.15

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/README.md CHANGED
@@ -26,7 +26,7 @@ npm i kitzo
26
26
  or
27
27
 
28
28
  ```javascript
29
- <script src="https://cdn.jsdelivr.net/npm/kitzo@2.1.14/dist/kitzo.umd.min.js"></script>
29
+ <script src="https://cdn.jsdelivr.net/npm/kitzo@2.1.15/dist/kitzo.umd.min.js"></script>
30
30
  ```
31
31
 
32
32
  > Vanilla: Attach this script tag in the html head tag and you are good to go.
package/dist/react.esm.js CHANGED
@@ -713,7 +713,19 @@ function useScrollRestoration(path, key, options = {}) {
713
713
  const mapKey = `${pathname}::${key}`;
714
714
  const saved = history.current.get(mapKey);
715
715
  const restore = () => {
716
- if (!saved) return;
716
+ if (!saved) {
717
+ window.scrollTo({
718
+ top: 0,
719
+ left: 0,
720
+ behavior: 'auto'
721
+ });
722
+ element.scrollTo({
723
+ top: 0,
724
+ left: 0,
725
+ behavior: 'auto'
726
+ });
727
+ return;
728
+ }
717
729
  if (isWindow) {
718
730
  window.scrollTo({
719
731
  top: saved.top,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.1.14",
3
+ "version": "2.1.15",
4
4
  "description": "A lightweight JavaScript UI micro-library.",
5
5
  "type": "module",
6
6
  "main": "./dist/kitzo.umd.js",