@tanstack/svelte-virtual 3.13.52 → 3.13.54

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 CHANGED
@@ -48,7 +48,11 @@ export function createWindowVirtualizer(options) {
48
48
  observeElementRect: observeWindowRect,
49
49
  observeElementOffset: observeWindowOffset,
50
50
  scrollToFn: windowScroll,
51
- initialOffset: () => (typeof document !== 'undefined' ? window.scrollY : 0),
51
+ initialOffset: () => typeof document !== 'undefined'
52
+ ? options.horizontal
53
+ ? window.scrollX
54
+ : window.scrollY
55
+ : 0,
52
56
  ...options,
53
57
  });
54
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/svelte-virtual",
3
- "version": "3.13.52",
3
+ "version": "3.13.54",
4
4
  "description": "Headless UI for virtualizing scrollable elements in Svelte",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "src"
42
42
  ],
43
43
  "dependencies": {
44
- "@tanstack/virtual-core": "3.19.11"
44
+ "@tanstack/virtual-core": "3.19.13"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@sveltejs/package": "^2.3.11",
package/src/index.ts CHANGED
@@ -103,7 +103,12 @@ export function createWindowVirtualizer<TItemElement extends Element>(
103
103
  observeElementRect: observeWindowRect,
104
104
  observeElementOffset: observeWindowOffset,
105
105
  scrollToFn: windowScroll,
106
- initialOffset: () => (typeof document !== 'undefined' ? window.scrollY : 0),
106
+ initialOffset: () =>
107
+ typeof document !== 'undefined'
108
+ ? options.horizontal
109
+ ? window.scrollX
110
+ : window.scrollY
111
+ : 0,
107
112
  ...options,
108
113
  })
109
114
  }