Skip to content

Commit 3f032d2

Browse files
committed
Revert unnecessary changes.
1 parent 47f06f5 commit 3f032d2

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/Components/Web.JS/src/Services/NavigationEnhancement.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,17 @@ export function detachProgressivelyEnhancedNavigationListener() {
7474
function performProgrammaticEnhancedNavigation(absoluteInternalHref: string, replace: boolean) : void {
7575
let isSelfNavigation = isForSamePath(absoluteInternalHref, location.href);
7676

77-
performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ false);
78-
79-
if (!isSelfNavigation) {
80-
resetScrollAfterNextBatch();
81-
}
82-
83-
// history update should be the last step - same as in client side routing
8477
if (replace) {
8578
history.replaceState(null, /* ignored title */ '', absoluteInternalHref);
8679
} else {
8780
history.pushState(null, /* ignored title */ '', absoluteInternalHref);
8881
}
82+
83+
if (!isSelfNavigation) {
84+
resetScrollAfterNextBatch();
85+
}
86+
87+
performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ false);
8988
}
9089

9190
function getCurrentScrollPosition() {
@@ -119,11 +118,9 @@ function onDocumentClick(event: MouseEvent) {
119118
performScrollToElementOnTheSamePage(absoluteInternalHref);
120119
} else {
121120
let isSelfNavigation = isForSamePath(absoluteInternalHref, location.href);
122-
if (!isSelfNavigation) {
123-
resetScrollAfterNextBatch();
124-
}
125121
performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ true);
126122
if (!isSelfNavigation) {
123+
resetScrollAfterNextBatch();
127124
resetScrollIfNeeded();
128125
}
129126
}

0 commit comments

Comments
 (0)