mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-24 23:04:32 -04:00
Fixed instant loading jumping back to the top
This commit is contained in:
@@ -206,6 +206,7 @@ export function setupInstantLoading(
|
||||
sample(response$)
|
||||
)
|
||||
.subscribe(({ url }) => {
|
||||
console.log("history.pushState")
|
||||
history.pushState({}, "", `${url}`)
|
||||
})
|
||||
|
||||
@@ -288,7 +289,7 @@ export function setupInstantLoading(
|
||||
sample(document$)
|
||||
)
|
||||
.subscribe(({ url, offset }) => {
|
||||
if (url.hash && !offset) {
|
||||
if (url.hash && !offset?.y) {
|
||||
setLocationHash(url.hash)
|
||||
} else {
|
||||
window.scrollTo(0, offset?.y || 0)
|
||||
|
||||
Reference in New Issue
Block a user