Skip to content

Commit f620ca1

Browse files
committed
Add page name when resetting page
1 parent 351704b commit f620ca1

File tree

6 files changed

+6
-5
lines changed

6 files changed

+6
-5
lines changed

CHANGELOG.md

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

1616
- Updated some ES translations - https://github.com/rappasoft/laravel-livewire-tables/pull/577
1717
- Updated some AR translations - https://github.com/rappasoft/laravel-livewire-tables/pull/580
18+
- Add page name when resetting page - https://github.com/rappasoft/laravel-livewire-tables/issues/590
1819

1920
## [1.21.0] - 2021-11-20
2021

docs/bulk-actions/resetting-after-bulk-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function myBulkAction()
3434
$this->resetSearch(); // Remove the search query
3535
$this->resetSorts(); // Remove the sorts
3636
$this->resetBulk(); // Clear the selected rows
37-
$this->resetPage(); // Go back to page 1
37+
$this->resetPage($this->pageName()); // Go back to page 1
3838
}
3939
```

src/DataTableComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function resetAll(): void
189189
$this->resetSearch();
190190
$this->resetSorts();
191191
$this->resetBulk();
192-
$this->resetPage();
192+
$this->resetPage($this->pageName());
193193
}
194194

195195
/**

src/Traits/WithFilters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function updatedFilters(): void
9898
$this->checkFilters();
9999

100100
// Reset the page when filters are changed
101-
$this->resetPage();
101+
$this->resetPage($this->pageName());
102102
}
103103

104104
/**

src/Traits/WithPerPagePagination.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function updatedPerPage($value): void
3939
session()->put($this->getPerPagePaginationSessionKey(), $this->perPageAccepted[0] ?? 10);
4040
}
4141

42-
$this->resetPage();
42+
$this->resetPage($this->pageName());
4343
}
4444

4545
public function applyPagination($query)

src/Traits/WithReordering.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private function setReorderingProperties(): void
6969
$this->secondaryHeader = false;
7070
$this->customFooter = false;
7171
$this->useHeaderAsFooter = false;
72-
$this->resetPage();
72+
$this->resetPage($this->pageName());
7373
} else {
7474
$this->reordering = false;
7575

0 commit comments

Comments
 (0)