Open tudoanh opened 1 year ago
And when user navigate back, the scroll position is not right. It's always scrolling to the top of the page.
I've had the same issue. Especially if using infinite scroll upwards, rather than downwards.
Solution: Do not use hx-push-url
when infinite loading pagination. Just push the main URL once. That will keep the history right.
But it's still scroll to the top.
The problem:
When user perform scroll to end of page, I fetch more data from URL
/products/?infinite=True
, thenhx-push-url=/products/?page={{current_page}}
.But after user click to see an item detail, then navigate back, the content only shows last page, not the whole history as I expected.
Example:
User access
?page=1
, then?page=2
, items from page 2 will append to the end. The content of page 1 still show.After user access an item and then back, the page is show only content from page 2, the content of page 1 has been disappeared.
And when user navigate back, the scroll position is not right. It's always scrolling to the top of the page.