Skip to content

Commit

Permalink
Handle nested depending widgets, e.g. groups
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Jul 5, 2023
1 parent d1e9be4 commit 693f65b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Resources/public/js/be_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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++) {
Expand Down

0 comments on commit 693f65b

Please sign in to comment.