File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -604,23 +604,25 @@ class FormElementDependenceController {
604604 result = this . evalCondition ( subcondition . condition , subcondition . operator ) ;
605605 } else {
606606 // Otherwise check if we have this element in the form, or use fallback value
607+ let refValues = Array . isArray ( subcondition ) ? subcondition : [ subcondition ] ;
607608 let dependentValues = [ ] ;
608609 const dependentEl = document . getElementById ( this . mapFieldId ( dependentField ) ) ;
609610 if ( dependentEl ) {
610611 if ( dependentEl . tagName === 'SELECT' ) {
611612 dependentValues = this . getSelectValues ( dependentEl ) ;
613+ refValues = refValues . map ( String ) ;
612614 } else if ( dependentEl . tagName === 'INPUT' && [ 'radio' , 'checkbox' ] . includes ( dependentEl . type ) ) {
613615 dependentValues . push ( dependentEl . checked ) ;
614616 } else {
615617 dependentValues . push ( dependentEl . value ) ;
618+ refValues = refValues . map ( String ) ;
616619 }
617620 } else {
618621 const fallbackValues = this . config . field_values ?. [ this . mapFieldId ( dependentField ) ] ;
619622 if ( fallbackValues ) {
620623 dependentValues = Array . isArray ( fallbackValues ) ? fallbackValues : [ fallbackValues ] ;
621624 }
622625 }
623- const refValues = Array . isArray ( subcondition ) ? subcondition : [ subcondition ] ;
624626 result = dependentValues . some ( ( val ) => refValues . includes ( val ) ) ;
625627 }
626628 results . push ( result )
You can’t perform that action at this time.
0 commit comments