Skip to content

Commit

Permalink
ENGCOM-4761: Fiexed 22152 - Click on search icon it does not working …
Browse files Browse the repository at this point in the history
…on admin grid sticky header #22154
  • Loading branch information
sidolov authored Apr 18, 2019
2 parents 6f24b51 + 96d577c commit 2c0813b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
23 changes: 19 additions & 4 deletions app/code/Magento/Ui/view/base/web/js/grid/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ define([
'uiLayout',
'mage/translate',
'mageUtils',
'uiElement'
], function (_, layout, $t, utils, Element) {
'uiElement',
'jquery'
], function (_, layout, $t, utils, Element, $) {
'use strict';

return Element.extend({
Expand All @@ -29,11 +30,13 @@ define([
tracks: {
value: true,
previews: true,
inputValue: true
inputValue: true,
focused: true
},
imports: {
inputValue: 'value',
updatePreview: 'value'
updatePreview: 'value',
focused: false
},
exports: {
value: '${ $.provider }:params.search'
Expand Down Expand Up @@ -88,6 +91,18 @@ define([
return this;
},

/**
* Click To ScrollTop.
*/
scrollTo: function ($data) {
$('html, body').animate({
scrollTop: 0
}, 'slow', function () {
$data.focused = false;
$data.focused = true;
});
},

/**
* Resets input value to the last applied state.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
-->
<div class="data-grid-search-control-wrap">
<label class="data-grid-search-label" attr="title: $t('Search'), for: index">
<label class="data-grid-search-label" attr="title: $t('Search'), for: index" data-bind="click: scrollTo">
<span translate="'Search'"/>
</label>
<input class="admin__control-text data-grid-search-control" type="text"
Expand All @@ -16,6 +16,7 @@
placeholder: $t(placeholder)
},
textInput: inputValue,
hasFocus: focused,
keyboard: {
13: apply.bind($data, false),
27: cancel
Expand Down

0 comments on commit 2c0813b

Please sign in to comment.