diff --git a/src/Resources/public/js/be_main.js b/src/Resources/public/js/be_main.js index 4a7e6b3..e869581 100644 --- a/src/Resources/public/js/be_main.js +++ b/src/Resources/public/js/be_main.js @@ -854,7 +854,7 @@ var updateDependingFields = function(formElement) { }); } - if (valueMatches(dependsOnData.value, value)) { + if (valueMatches(dependsOnData.value, value) && !input.disabled) { widget.style.display = 'block'; restoreDependingFormFields(widget); } @@ -863,6 +863,11 @@ var updateDependingFields = function(formElement) { removeDependingFormFields(widget); } + // Handle nested depending widgets, e.g. groups + widget.getElements('input,textarea,select').each(function(input) { + input.fireEvent('change'); + }); + function valueMatches(dependingValue, actualValue) { if (Array.isArray(dependingValue)) { for (var i = 0; i < dependingValue.length; i++) {