@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.esm.js
CHANGED
|
@@ -295,6 +295,10 @@ var Scroll = class {
|
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
this.save();
|
|
298
|
+
this.scrollToAnchor();
|
|
299
|
+
}
|
|
300
|
+
static scrollToAnchor() {
|
|
301
|
+
const anchorHash = typeof window !== "undefined" ? window.location.hash : null;
|
|
298
302
|
if (anchorHash) {
|
|
299
303
|
setTimeout(() => {
|
|
300
304
|
const anchorElement = document.getElementById(anchorHash.slice(1));
|
|
@@ -1000,6 +1004,8 @@ var InitialVisit = class {
|
|
|
1000
1004
|
page.set(page.get(), { preserveScroll: true, preserveState: true }).then(() => {
|
|
1001
1005
|
if (navigationType.isReload()) {
|
|
1002
1006
|
Scroll.restore(history.getScrollRegions());
|
|
1007
|
+
} else {
|
|
1008
|
+
Scroll.scrollToAnchor();
|
|
1003
1009
|
}
|
|
1004
1010
|
fireNavigateEvent(page.get());
|
|
1005
1011
|
});
|