@inertiajs/core 2.2.18 → 2.2.19
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.esm.js +6 -0
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +6 -0
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
- package/types/scroll.d.ts +1 -0
- package/types/types.d.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -350,6 +350,10 @@ var Scroll = class {
|
|
|
350
350
|
}
|
|
351
351
|
});
|
|
352
352
|
this.save();
|
|
353
|
+
this.scrollToAnchor();
|
|
354
|
+
}
|
|
355
|
+
static scrollToAnchor() {
|
|
356
|
+
const anchorHash = typeof window !== "undefined" ? window.location.hash : null;
|
|
353
357
|
if (anchorHash) {
|
|
354
358
|
setTimeout(() => {
|
|
355
359
|
const anchorElement = document.getElementById(anchorHash.slice(1));
|
|
@@ -1055,6 +1059,8 @@ var InitialVisit = class {
|
|
|
1055
1059
|
page.set(page.get(), { preserveScroll: true, preserveState: true }).then(() => {
|
|
1056
1060
|
if (navigationType.isReload()) {
|
|
1057
1061
|
Scroll.restore(history.getScrollRegions());
|
|
1062
|
+
} else {
|
|
1063
|
+
Scroll.scrollToAnchor();
|
|
1058
1064
|
}
|
|
1059
1065
|
fireNavigateEvent(page.get());
|
|
1060
1066
|
});
|