File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
app/code/Magento/Ui/view/base/web/js/grid Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ define([
37
37
totalSelected : '${ $.selectProvider }:totalSelected' ,
38
38
totalRecords : '${ $.provider }:data.totalRecords' ,
39
39
filters : '${ $.provider }:params.filters' ,
40
- search : '${ $.provider }:params.search '
40
+ keywordUpdated : '${ $.provider }:params.keywordUpdated '
41
41
} ,
42
42
43
43
exports : {
@@ -60,7 +60,7 @@ define([
60
60
'pageSize' : 'onPageSizeChange' ,
61
61
'totalRecords' : 'updateCounter' ,
62
62
'${ $.provider }:params.filters' : 'goFirst' ,
63
- 'search ' : 'goFirst'
63
+ 'keywordUpdated ' : 'goFirst'
64
64
} ,
65
65
66
66
modules : {
@@ -186,7 +186,7 @@ define([
186
186
* @returns {Paging } Chainable.
187
187
*/
188
188
goFirst : function ( ) {
189
- if ( ! _ . isUndefined ( this . filters ) ) {
189
+ if ( ( ! _ . isUndefined ( this . filters ) && _ . keys ( this . filters ) > 1 ) || this . keywordUpdated ) {
190
190
this . current = 1 ;
191
191
}
192
192
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ define([
22
22
placeholder : $t ( 'Search by keyword' ) ,
23
23
label : $t ( 'Keyword' ) ,
24
24
value : '' ,
25
+ keywordUpdated : false ,
25
26
previews : [ ] ,
26
27
chipsProvider : 'componentType = filtersChips, ns = ${ $.ns }' ,
27
28
statefull : {
@@ -31,15 +32,17 @@ define([
31
32
value : true ,
32
33
previews : true ,
33
34
inputValue : true ,
34
- focused : true
35
+ focused : true ,
36
+ keywordUpdated : true
35
37
} ,
36
38
imports : {
37
39
inputValue : 'value' ,
38
40
updatePreview : 'value' ,
39
41
focused : false
40
42
} ,
41
43
exports : {
42
- value : '${ $.provider }:params.search'
44
+ value : '${ $.provider }:params.search' ,
45
+ keywordUpdated : '${ $.provider }:params.keywordUpdated'
43
46
} ,
44
47
modules : {
45
48
chips : '${ $.chipsProvider }'
@@ -124,6 +127,7 @@ define([
124
127
apply : function ( value ) {
125
128
value = value || this . inputValue ;
126
129
130
+ this . keywordUpdated = this . value !== this . inputValue ;
127
131
this . value = this . inputValue = value . trim ( ) ;
128
132
129
133
return this ;
You can’t perform that action at this time.
0 commit comments