Skip to content

Commit b5b79b7

Browse files
committed
MC-38787: Admin Product Grid Page indicator issue
1 parent 36640fd commit b5b79b7

File tree

1 file changed

+13
-5
lines changed
  • app/code/Magento/Ui/view/base/web/js/grid/paging

1 file changed

+13
-5
lines changed

app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ define([
6060
'pageSize': 'onPageSizeChange',
6161
'totalRecords': 'updateCounter',
6262
'${ $.provider }:params.filters': 'goFirst',
63-
'${ $.provider }:params.search': 'goFirst'
63+
'${ $.provider }:params.search': 'onSearchUpdate'
6464
},
6565

6666
modules: {
@@ -186,10 +186,7 @@ define([
186186
* @returns {Paging} Chainable.
187187
*/
188188
goFirst: function () {
189-
if (
190-
(!_.isUndefined(this.filters) && _.keys(this.filters) > 1) ||
191-
(!_.isUndefined(this.keywordUpdated) && this.keywordUpdated)
192-
) {
189+
if (!_.isUndefined(this.filters)) {
193190
this.current = 1;
194191
}
195192

@@ -287,6 +284,17 @@ define([
287284
*/
288285
onPagesChange: function () {
289286
this.updateCursor();
287+
},
288+
289+
/**
290+
* Resent the pagination to Page 1 on search keyword update
291+
*/
292+
onSearchUpdate: function () {
293+
if (!_.isUndefined(this.keywordUpdated) && this.keywordUpdated) {
294+
this.goFirst();
295+
}
296+
297+
return this;
290298
}
291299
});
292300
});

0 commit comments

Comments
 (0)