You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting preserveUrl for the WhenVisible component, data loaded from the next page is not merged. In fact nothing happens. Not setting preserveUrl at all allows infinite scroll to work (ie. the next items are merged) but of course the page url is changed per each request.
The callbacks are required to fulfill the promise in page.ts.
My rudimentary fix was something along the lines of the following (in replaceState / pushState) but I have am not sure of the wider impact of that kind of change.
if (isServer) {
return
}
if (this.preserveUrl) {
cb && cb()
return
}
I mention the diff between beta2 and beta3 but the problem exists on v2.0.0 just the same.
Steps to reproduce:
This is easily reproduced in the Vue3 playground environment.
Check out this project on the latest tag and follow the steps to get the project running. From the vue3 playground visit the infinite scroll route and see that the next page does not get merged when you reach the end of the list.
(Note: The playground is also sort of broken for vue3 - you will need to replace :once="false" with always in the <WhenVisible> component of the InfiniteScroll.vue page. )
The text was updated successfully, but these errors were encountered:
I dont think is a bug only with WhenVisible component but all partials reload with data params and preserveUrl. I have try this and does not work with inertia v2.0.0
useEffect(()=>{// Does not changes tasks and pagy propssetTimeout(()=>{router.reload({only: ["tasks","pagy"],preserveUrl: true,data: {page: 2}});})},[]);
Versions:
@inertiajs/core
version: 2.0.0Describe the problem:
When setting preserveUrl for the
WhenVisible
component, data loaded from the next page is not merged. In fact nothing happens. Not setting preserveUrl at all allows infinite scroll to work (ie. the next items are merged) but of course the page url is changed per each request.This was introduced between
v2.0.0-beta.2
andv2.0.0-beta.3
.Specifically, a refactor to the
pushState
andreplaceState
methods ofhistory.ts
in the core:history.ts change
The callbacks are required to fulfill the promise in
page.ts
.My rudimentary fix was something along the lines of the following (in
replaceState
/pushState
) but I have am not sure of the wider impact of that kind of change.I mention the diff between beta2 and beta3 but the problem exists on v2.0.0 just the same.
Steps to reproduce:
This is easily reproduced in the Vue3 playground environment.
Check out this project on the latest tag and follow the steps to get the project running. From the vue3 playground visit the infinite scroll route and see that the next page does not get merged when you reach the end of the list.
(Note: The playground is also sort of broken for vue3 - you will need to replace
:once="false"
withalways
in the<WhenVisible>
component of theInfiniteScroll.vue
page. )The text was updated successfully, but these errors were encountered: