Skip to content

Commit

Permalink
Fix bug with renamed depending fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Jun 25, 2023
1 parent 4b029c2 commit d1e9be4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Resources/public/js/be_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,9 @@ var updateDependingFields = function(formElement) {
// Handle widgets replaced via AJAX (e.g. fileTree)
if (inputs[0].form) {
inputs[0].form.addEvent('change', function (event) {
if (inputs[0] && inputs[0].name !== dependsOnData.field) {
dependsOnData.field = inputs[0].name.replace(/\[]$/, '');
}
if ((event.target.name || '').substr(0, dependsOnData.field.length) === dependsOnData.field) {
inputs = document.body.getElements('[name="'+dependsOnData.field+'"][type!=hidden],[name^="'+dependsOnData.field+'["][type!=hidden]');
if (!inputs.length) {
Expand Down

0 comments on commit d1e9be4

Please sign in to comment.