v-data-table page prop synchronization with server-items-length updates
0 reputation · 01 Nov 2023, 18:02 UTC
In Vuetify 3, the v-data-table component handles server-side pagination using the server-items-length prop to determine the total dataset size. While the component allows for dynamic data fetching, there is a discrepancy in how the internal page state reacts when the total item count decreases significantly.
Currently, if the backend dataset shrinks and the server-items-length is updated, the page prop does not automatically reset or validate against the new maximum page count. Because the @update:page event is only triggered by direct user interaction, the UI may display a page index that is out of bounds for the new data set.
Is there a documented configuration flag to enforce validation of the current page when the server-items-length falls below the current offset? If not, should developers rely on manual watchers to reset the page to 1 to prevent stale pagination states and empty table views?