Skip to content

Commit 9a74e7b

Browse files
committed
Fix the search feature if pagination is on, and you're not searching from the first page using Livewire's native resetPage() method.
1 parent 23a6a30 commit 9a74e7b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
99
### Changed
1010

1111
- Ability to turn off per page option while keeping pagination on
12+
- Fix the search feature if pagination is on, and you're not searching from the first page using Livewire's native resetPage() method.
1213

1314
## [0.1.2] - 2020-04-28
1415

src/Traits/Pagination.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ trait Pagination
4646
* @var string
4747
*/
4848
public $perPageLabel;
49+
50+
/**
51+
* https://laravel-livewire.com/docs/pagination
52+
* Resetting Pagination After Filtering Data
53+
*/
54+
public function updatingSearch() : void
55+
{
56+
$this->resetPage();
57+
}
4958
}

0 commit comments

Comments
 (0)