inertiax-core 11.0.8 → 11.0.10
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 +14 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/types/scroll.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1050,8 +1050,11 @@ var Scroll = class {
|
|
|
1050
1050
|
window.scrollTo(0, 0);
|
|
1051
1051
|
}
|
|
1052
1052
|
static reset(frameId = DEFAULT_FRAME_ID2) {
|
|
1053
|
+
if (frameId !== DEFAULT_FRAME_ID2) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1053
1056
|
const anchorHash = isServer2 ? null : window.location.hash;
|
|
1054
|
-
if (
|
|
1057
|
+
if (!anchorHash) {
|
|
1055
1058
|
this.scrollToTop();
|
|
1056
1059
|
}
|
|
1057
1060
|
this.regions().forEach((region) => {
|
|
@@ -1063,9 +1066,12 @@ var Scroll = class {
|
|
|
1063
1066
|
}
|
|
1064
1067
|
});
|
|
1065
1068
|
this.save(frameId);
|
|
1066
|
-
this.scrollToAnchor();
|
|
1069
|
+
this.scrollToAnchor(frameId);
|
|
1067
1070
|
}
|
|
1068
|
-
static scrollToAnchor() {
|
|
1071
|
+
static scrollToAnchor(frameId = DEFAULT_FRAME_ID2) {
|
|
1072
|
+
if (frameId !== DEFAULT_FRAME_ID2) {
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1069
1075
|
const anchorHash = isServer2 ? null : window.location.hash;
|
|
1070
1076
|
if (anchorHash) {
|
|
1071
1077
|
setTimeout(() => {
|
|
@@ -1078,6 +1084,9 @@ var Scroll = class {
|
|
|
1078
1084
|
if (isServer2) {
|
|
1079
1085
|
return;
|
|
1080
1086
|
}
|
|
1087
|
+
if (frameId !== DEFAULT_FRAME_ID2) {
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1081
1090
|
window.requestAnimationFrame(() => {
|
|
1082
1091
|
this.restoreDocument(frameId);
|
|
1083
1092
|
this.restoreScrollRegions(scrollRegions);
|
|
@@ -1372,7 +1381,7 @@ var CurrentFramePage = class {
|
|
|
1372
1381
|
set(page2, {
|
|
1373
1382
|
replace = false,
|
|
1374
1383
|
updateBrowserUrl = this.frameId === DEFAULT_FRAME_ID3,
|
|
1375
|
-
preserveScroll =
|
|
1384
|
+
preserveScroll = false,
|
|
1376
1385
|
preserveState = false,
|
|
1377
1386
|
viewTransition = false
|
|
1378
1387
|
} = {}) {
|
|
@@ -1850,7 +1859,7 @@ var InitialVisit = class {
|
|
|
1850
1859
|
if (navigationType.isReload()) {
|
|
1851
1860
|
Scroll.restore(history.getScrollRegions(frameId), frameId);
|
|
1852
1861
|
} else {
|
|
1853
|
-
Scroll.scrollToAnchor();
|
|
1862
|
+
Scroll.scrollToAnchor(frameId);
|
|
1854
1863
|
}
|
|
1855
1864
|
this.fireInitialEvents(frameId);
|
|
1856
1865
|
});
|