Skip to content

Commit 2c6676e

Browse files
author
Olexandr Lysenko
committed
Merge remote-tracking branch 'origin/MAGETWO-59159' into bugfixes
2 parents f75b2eb + fa48626 commit 2c6676e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
define([
88
'jquery',
99
'mage/template',
10+
'underscore',
1011
'jquery/ui',
1112
'mage/validation'
12-
], function ($, mageTemplate) {
13+
], function ($, mageTemplate, _) {
1314
'use strict';
1415

1516
$.widget('mage.regionUpdater', {
@@ -124,6 +125,8 @@ define([
124125
* @private
125126
*/
126127
_clearError: function () {
128+
var args = ['clearError', this.options.regionListId, this.options.regionInputId, this.options.postcodeId];
129+
127130
if (this.options.clearError && typeof this.options.clearError === 'function') {
128131
this.options.clearError.call(this);
129132
} else {
@@ -133,8 +136,8 @@ define([
133136

134137
this.options.form = $(this.options.form);
135138

136-
this.options.form && this.options.form.data('validator') && this.options.form.validation('clearError',
137-
this.options.regionListId, this.options.regionInputId, this.options.postcodeId);
139+
this.options.form && this.options.form.data('validator') &&
140+
this.options.form.validation.apply(this.options.form, _.compact(args));
138141

139142
// Clean up errors on region & zip fix
140143
$(this.options.regionInputId).removeClass('mage-error').parent().find('[generated]').remove();

0 commit comments

Comments
 (0)