Adding comments for Photos page's filters handling issue
This commit is contained in:
@@ -35,8 +35,12 @@
|
||||
// Scroll back to top between page transitions
|
||||
setTimeout(() => {
|
||||
// scrollToTop()
|
||||
// Disable scroll when changing filters on /photos?
|
||||
if (!$page.query.get('country')) {
|
||||
window.scrollTo(0,0)
|
||||
}, DURATION.PAGE_OUT)
|
||||
}
|
||||
|
||||
}, DURATION.PAGE_OUT * 1.5)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -89,7 +89,12 @@
|
||||
urlFiltersParams.set('country', filterCountry)
|
||||
urlFiltersParams.set('sort', filterSort)
|
||||
|
||||
let path: string = `${$page.path}?${urlFiltersParams.toString()}`
|
||||
let path = `${$page.path}?${urlFiltersParams.toString()}`
|
||||
console.log(path)
|
||||
|
||||
// TODO: Load new params properly?
|
||||
// 1. How to properly navigate to new page / 2. Avoid scrolling to top (from global __layout)
|
||||
// Feels like it calls the url multiple times
|
||||
goto(path, { replaceState: true, keepfocus: true, noscroll: true })
|
||||
}
|
||||
|
||||
@@ -245,7 +250,7 @@
|
||||
})
|
||||
}, {
|
||||
threshold: 0.3,
|
||||
rootMargin: '0px 0px 0px'
|
||||
rootMargin: '0px 0px 10%'
|
||||
})
|
||||
|
||||
// Photos MutationObserver
|
||||
@@ -269,6 +274,7 @@
|
||||
|
||||
// Destroy
|
||||
return () => {
|
||||
// Disconnect observers
|
||||
observerPhotos && observerPhotos.disconnect()
|
||||
mutationPhotos && mutationPhotos.disconnect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user