Skip to content

Commit

Permalink
MC-42051: Fix jQuery.fn.blur() (#43)
Browse files Browse the repository at this point in the history
- Replace deprecated blur() function
  • Loading branch information
jcuerdo authored May 26, 2021
1 parent d239f6c commit 95445b3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ define([
*/
_OnMoreClick: function ($this) {
$this.nextAll().show();
$this.blur().remove();
$this.trigger('blur').remove();
},

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/view/base/web/js/block-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ define([
* @param {Object} element
*/
function addBlockLoader(element) {
element.find(':focus').blur();
element.find(':focus').trigger('blur');
element.find('input:disabled, select:disabled').addClass('_disabled');
element.find('input, select').prop('disabled', true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ define([

if (this.isTabKey(event)) {
if (!this.filterOptionsFocus() && this.listVisible() && this.filterOptions) {
this.cacheUiSelect.blur();
this.cacheUiSelect.trigger('blur');
this.filterOptionsFocus(true);
this.cleanHoveredElement();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ define([

if (!options.timeOnly) {
$element.datepicker('setDate', newVal);
$element.blur();
$element.trigger('blur');
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ define([
momentFormat = utils.convertToMomentFormat(inputFormat);
todayDate = moment().format(momentFormat);

element.datepicker('setTimezoneDate').blur().trigger('change');
element.datepicker('setTimezoneDate').trigger('blur').trigger('change');
result = moment(observable()).format(momentFormat);

expect(todayDate).toEqual(result);
Expand All @@ -71,7 +71,7 @@ define([
});

it('clear picked date\'s value after clear observable value', function () {
element.datepicker('setTimezoneDate').blur().trigger('change');
element.datepicker('setTimezoneDate').trigger('blur').trigger('change');
observable('');

jasmine.clock().tick(100);
Expand Down
2 changes: 1 addition & 1 deletion lib/web/mage/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ define([
//Set date/time according to timezone offset
$(el).datepicker('setTimezoneDate')
// To ensure that user can re-select date field without clicking outside it first.
.blur().trigger('change');
.trigger('blur').trigger('change');
};

return {
Expand Down

0 comments on commit 95445b3

Please sign in to comment.