File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
app/code/Magento/Ui/view/base/web/js/grid/paging Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ define([
60
60
'pageSize' : 'onPageSizeChange' ,
61
61
'totalRecords' : 'updateCounter' ,
62
62
'${ $.provider }:params.filters' : 'goFirst' ,
63
- '${ $.provider }:params.search' : 'goFirst '
63
+ '${ $.provider }:params.search' : 'onSearchUpdate '
64
64
} ,
65
65
66
66
modules : {
@@ -186,10 +186,7 @@ define([
186
186
* @returns {Paging } Chainable.
187
187
*/
188
188
goFirst : function ( ) {
189
- if (
190
- ( ! _ . isUndefined ( this . filters ) && _ . keys ( this . filters ) > 1 ) ||
191
- ( ! _ . isUndefined ( this . keywordUpdated ) && this . keywordUpdated )
192
- ) {
189
+ if ( ! _ . isUndefined ( this . filters ) ) {
193
190
this . current = 1 ;
194
191
}
195
192
@@ -287,6 +284,17 @@ define([
287
284
*/
288
285
onPagesChange : function ( ) {
289
286
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 ;
290
298
}
291
299
} ) ;
292
300
} ) ;
You can’t perform that action at this time.
0 commit comments