Skip to content

Commit afc4ac3

Browse files
committed
Fix.
1 parent 43b5fbf commit afc4ac3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import '@microsoft/dotnet-js-interop';
55
import { resetScrollAfterNextBatch } from '../Rendering/Renderer';
66
import { EventDelegator } from '../Rendering/Events/EventDelegator';
7-
import { attachEnhancedNavigationListener, getInteractiveRouterRendererId, handleClickForNavigationInterception, hasInteractiveRouter, hasProgrammaticEnhancedNavigationHandler, isSamePageWithHash, isWithinBaseUriSpace, performProgrammaticEnhancedNavigation, performScrollToElementOnTheSamePage, scrollToElement, setHasInteractiveRouter, toAbsoluteUri } from './NavigationUtils';
7+
import { attachEnhancedNavigationListener, getInteractiveRouterRendererId, handleClickForNavigationInterception, hasInteractiveRouter, hasProgrammaticEnhancedNavigationHandler, isForSamePath, isSamePageWithHash, isWithinBaseUriSpace, performProgrammaticEnhancedNavigation, performScrollToElementOnTheSamePage, scrollToElement, setHasInteractiveRouter, toAbsoluteUri } from './NavigationUtils';
88
import { WebRendererId } from '../Rendering/WebRendererId';
99
import { isRendererAttached } from '../Rendering/WebRendererInteropMethods';
1010

@@ -169,7 +169,9 @@ async function performInternalNavigation(absoluteInternalHref: string, intercept
169169
// position, so reset it.
170170
// To avoid ugly flickering effects, we don't want to change the scroll position until
171171
// we render the new page. As a best approximation, wait until the next batch.
172-
resetScrollAfterNextBatch();
172+
if (!isForSamePath(absoluteInternalHref, location.href)) {
173+
resetScrollAfterNextBatch();
174+
}
173175

174176
saveToBrowserHistory(absoluteInternalHref, replace, state);
175177

0 commit comments

Comments
 (0)