Merged in fix/scroll-to-top-issue (pull request #2892)
fix: Update route info inside store before checking if path or lang has changed * fix: Update route info inside store before checking if path or lang has changed Approved-by: Linus Flood
This commit is contained in:
committed by
Linus Flood
parent
85a925f281
commit
57315baf97
@@ -29,12 +29,13 @@ export default function RouteChange() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateRouteInfo(pathName, currentLang, searchParams)
|
||||||
|
|
||||||
if (hasPathOrLangChanged()) {
|
if (hasPathOrLangChanged()) {
|
||||||
// Scroll to top on page load whenever page is navigated to new URL (page)
|
// Scroll to top on page load whenever page is navigated to new URL (page)
|
||||||
window.scrollTo({ top: 0, left: 0, behavior: "instant" })
|
window.scrollTo({ top: 0, left: 0, behavior: "instant" })
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRouteInfo(pathName, currentLang, searchParams)
|
|
||||||
if (
|
if (
|
||||||
hasPathOrLangChanged() ||
|
hasPathOrLangChanged() ||
|
||||||
hasBookingFlowParamsChanged(isSameBookingWidgetParams)
|
hasBookingFlowParamsChanged(isSameBookingWidgetParams)
|
||||||
|
|||||||
@@ -29,12 +29,13 @@ export default function RouteChange() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateRouteInfo(pathName, currentLang, searchParams)
|
||||||
|
|
||||||
if (hasPathOrLangChanged()) {
|
if (hasPathOrLangChanged()) {
|
||||||
// Scroll to top on page load whenever page is navigated to new URL (page)
|
// Scroll to top on page load whenever page is navigated to new URL (page)
|
||||||
window.scrollTo({ top: 0, left: 0, behavior: "instant" })
|
window.scrollTo({ top: 0, left: 0, behavior: "instant" })
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRouteInfo(pathName, currentLang, searchParams)
|
|
||||||
if (
|
if (
|
||||||
hasPathOrLangChanged() ||
|
hasPathOrLangChanged() ||
|
||||||
hasBookingFlowParamsChanged(isSameBookingWidgetParams)
|
hasBookingFlowParamsChanged(isSameBookingWidgetParams)
|
||||||
|
|||||||
Reference in New Issue
Block a user