Livewire pagination does not reset page after query filter changes
0 reputation · 19 Aug 2021, 22:14 UTC
A Livewire component using the WithPagination trait must maintain the current page number when the underlying data query is altered by filters or other parameters.
The component re‑renders on each pagination request, and the paginator is bound to the query string, yet there is no automatic reset of the page index when the result set size changes, potentially showing an empty page or stale links.
Developers must decide whether to manually invoke $this->resetPage() or implement a custom reset logic, but the framework does not provide a built‑in mechanism for this scenario.
How can Livewire be extended to automatically reset the page when the query changes? Is there a supported event or hook for this behavior? What is the recommended pattern for handling filter‑driven pagination resets?