Skip to content

Commit a02488d

Browse files
committed
fix(pat inject): Update the URL earlier
Update the history/URL after the injection has been done and before post processing - e.g. scanning for new patterns - is happening. Other patterns like pat-navigation are depending on an updated URL state.
1 parent 3091a29 commit a02488d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pat/inject/inject.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,14 @@ const inject = {
456456
const $injected = cfg.$injected || $src;
457457
// Now the injection actually happens.
458458
if (this._inject(trigger, $src, $(target), cfg)) {
459+
// Update history
460+
this._update_history(cfg, trigger, title);
461+
// Post-injection
459462
this._afterInjection($el, $injected, cfg);
460463
}
464+
},
465+
466+
_update_history(cfg, trigger, title) {
461467
// History support. if subform is submitted, append form params
462468
const glue = cfg.url.indexOf("?") > -1 ? "&" : "?";
463469
if (cfg.history === "record" && "pushState" in history) {

0 commit comments

Comments
 (0)