inertiax-core 11.0.24 → 11.0.25
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 +9 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -420,12 +420,19 @@ var History = class {
|
|
|
420
420
|
return pageData instanceof ArrayBuffer ? decryptHistory(pageData) : Promise.resolve(pageData);
|
|
421
421
|
}
|
|
422
422
|
saveScrollPositions(scrollRegions) {
|
|
423
|
-
|
|
423
|
+
const meaningful = scrollRegions.filter((_, i) => {
|
|
424
|
+
const el = document.querySelectorAll("[scroll-region]")[i];
|
|
425
|
+
return el ? el.scrollHeight > el.clientHeight : false;
|
|
426
|
+
});
|
|
427
|
+
if (meaningful.length === 0) {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
if (isEqual(this.getScrollRegions(), meaningful)) {
|
|
424
431
|
return;
|
|
425
432
|
}
|
|
426
433
|
const nextState = {
|
|
427
434
|
...window.history.state,
|
|
428
|
-
scrollRegions
|
|
435
|
+
scrollRegions: meaningful
|
|
429
436
|
};
|
|
430
437
|
try {
|
|
431
438
|
window.history.replaceState(nextState, "");
|