inertiax-core 11.0.22 → 11.0.24

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 CHANGED
@@ -1040,7 +1040,7 @@ var Scroll = class {
1040
1040
  if (frameId === DEFAULT_FRAME_ID2) {
1041
1041
  return Array.from(this.regions());
1042
1042
  }
1043
- const anchor = document.querySelector(`[data-inertia-frame="${frameId}"]`);
1043
+ const anchor = document.querySelector(`[data-inertia-frame="${CSS.escape(frameId)}"]`);
1044
1044
  if (!anchor?.parentElement) {
1045
1045
  return [];
1046
1046
  }
@@ -3336,6 +3336,14 @@ var Router = class {
3336
3336
  restore(key = "default") {
3337
3337
  return history.restore(key, this.frameId);
3338
3338
  }
3339
+ /**
3340
+ * Restore scroll positions from history state for this frame.
3341
+ * Call after programmatically restoring a frame from history (e.g.
3342
+ * when mounting a Frame that loads page data from the history stack).
3343
+ */
3344
+ restoreScroll() {
3345
+ Scroll.restore(history.getScrollRegions(), this.frameId);
3346
+ }
3339
3347
  on(type, callback) {
3340
3348
  if (typeof window === "undefined") {
3341
3349
  return () => {