From 693f65bcdcab2994e5ae99db89665b589fd235ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Wed, 5 Jul 2023 12:08:00 +0200 Subject: [PATCH] Handle nested depending widgets, e.g. groups --- src/Resources/public/js/be_main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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++) {