diff --git a/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js b/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js index e06b8922b2252fd497db66a79db35af8c543db09..eba77927be79ea6189884f412be03be7ec7a76be 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js @@ -7,9 +7,10 @@ define([ 'jquery', 'mage/template', + 'underscore', 'jquery/ui', 'mage/validation' -], function ($, mageTemplate) { +], function ($, mageTemplate, _) { 'use strict'; $.widget('mage.regionUpdater', { @@ -124,6 +125,8 @@ define([ * @private */ _clearError: function () { + var args = ['clearError', this.options.regionListId, this.options.regionInputId, this.options.postcodeId]; + if (this.options.clearError && typeof this.options.clearError === 'function') { this.options.clearError.call(this); } else { @@ -133,8 +136,8 @@ define([ this.options.form = $(this.options.form); - this.options.form && this.options.form.data('validator') && this.options.form.validation('clearError', - this.options.regionListId, this.options.regionInputId, this.options.postcodeId); + this.options.form && this.options.form.data('validator') && + this.options.form.validation.apply(this.options.form, _.compact(args)); // Clean up errors on region & zip fix $(this.options.regionInputId).removeClass('mage-error').parent().find('[generated]').remove();