@tanstack/virtual-core 3.19.5 → 3.19.6
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/cjs/index.cjs +4 -12
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +4 -12
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -12
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,8 +5,8 @@ const utils = require("./utils.cjs");
|
|
|
5
5
|
const scrollClassifier = require("./scroll-classifier.cjs");
|
|
6
6
|
const iosGesture = require("./ios-gesture.cjs");
|
|
7
7
|
const getRect = (element) => {
|
|
8
|
-
const {
|
|
9
|
-
return { width:
|
|
8
|
+
const { clientWidth, clientHeight } = element;
|
|
9
|
+
return { width: clientWidth, height: clientHeight };
|
|
10
10
|
};
|
|
11
11
|
const createFrameQueue = (targetWindow) => {
|
|
12
12
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -55,21 +55,13 @@ const observeElementRect = (instance, cb) => {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
const frames = createFrameQueue(targetWindow);
|
|
58
|
-
const observer = new targetWindow.ResizeObserver((
|
|
58
|
+
const observer = new targetWindow.ResizeObserver(() => {
|
|
59
59
|
const run = () => {
|
|
60
|
-
const entry = entries[0];
|
|
61
|
-
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
62
|
-
const box = entry.borderBoxSize[0];
|
|
63
|
-
if (box) {
|
|
64
|
-
handler({ width: box.inlineSize, height: box.blockSize });
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
60
|
handler(getRect(element));
|
|
69
61
|
};
|
|
70
62
|
instance.options.useAnimationFrameWithResizeObserver ? frames.schedule(run) : run();
|
|
71
63
|
});
|
|
72
|
-
observer.observe(element, { box: "
|
|
64
|
+
observer.observe(element, { box: "content-box" });
|
|
73
65
|
return () => {
|
|
74
66
|
observer.unobserve(element);
|
|
75
67
|
frames.cancel();
|