File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
app/code/Magento/Weee/view/adminhtml/web/js Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ define([
27
27
} ) ;
28
28
} ,
29
29
_initOptionItem : function ( ) {
30
- var widget = this ;
30
+ var widget = this ,
31
+ isOriginalRequired = $ ( widget . element ) . hasClass ( 'required' ) ;
31
32
32
33
this . _on ( {
33
34
//Add new tax item
@@ -44,6 +45,7 @@ define([
44
45
'change [data-role="select-country"]' : function ( event , data ) {
45
46
var currentElement = event . target || event . srcElement || event . currentTarget ,
46
47
parentElement = $ ( currentElement ) . closest ( '[data-role="fpt-item-row"]' ) ;
48
+
47
49
data = data || { } ;
48
50
var updater = new RegionUpdater (
49
51
parentElement . find ( '[data-role="select-country"]' ) . attr ( 'id' ) , null ,
@@ -55,6 +57,9 @@ define([
55
57
if ( data . state ) {
56
58
parentElement . find ( '[data-role="select-state"]' ) . val ( data . state ) ;
57
59
}
60
+ if ( ! isOriginalRequired && $ ( widget . element ) . hasClass ( 'required' ) ) {
61
+ $ ( widget . element ) . removeClass ( 'required' ) ;
62
+ }
58
63
}
59
64
} ) ;
60
65
Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ RegionUpdater.prototype = {
150
150
}
151
151
}
152
152
153
+ //compute the need for the required fields
153
154
if ( ! regionRequired || ! currentElement . visible ( ) ) {
154
155
if ( field . hasClassName ( 'required' ) ) {
155
156
field . removeClassName ( 'required' ) ;
You can’t perform that action at this time.
0 commit comments