Skip to content

Commit 1407038

Browse files
committed
fix(pagination): avoid initial double firing of paginationChanged
When initially loading a grid with `ui.grid.pagination` enabled, **paginationChanged** is triggered two times since the watcher values transition from `undefined` to the **initial value** Found while developing a `pageSize` feature on an alternate pagination project: michaelbromley/angularUtils#212
1 parent b6faacc commit 1407038

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/features/pagination/js/pagination.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@
375375
var deregT = $scope.$watch('grid.options.totalItems + grid.options.paginationPageSize', setShowing);
376376

377377
var deregP = $scope.$watch('grid.options.paginationCurrentPage + grid.options.paginationPageSize', function (newValues, oldValues) {
378-
if (newValues === oldValues) {
378+
if (newValues === oldValues || oldValues === undefined) {
379379
return;
380380
}
381381

0 commit comments

Comments
 (0)