Skip to content

Commit

Permalink
annotate repeatable panel
Browse files Browse the repository at this point in the history
  • Loading branch information
nit23uec committed Apr 17, 2024
1 parent 1b0d136 commit 4e7b49b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions blocks/form/components/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@ export default function transferRepeatableDOM(form) {
}
div.append(addButton);
div.className = 'repeat-wrapper';
div.parentElement.classList.add('repeatable');
div.parentElement.dataset.id = el.dataset.id;
});
}
7 changes: 6 additions & 1 deletion scripts/form-editor-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ function annotateItems(items, formDefinition, formFieldMap) {
if (fieldWrapper.classList.contains("panel-wrapper")) {
fieldWrapper.setAttribute('data-aue-type', 'container');
fieldWrapper.setAttribute('data-aue-behavior', 'component');
annotateItems(fieldWrapper.childNodes, formDefinition, formFieldMap);
if (fieldWrapper.classList.contains("repeatable")) {
let repeatableFieldWrapper = fieldWrapper.querySelector("[data-repeatable='true']");
annotateItems(repeatableFieldWrapper.childNodes, formDefinition, formFieldMap);
} else {
annotateItems(fieldWrapper.childNodes, formDefinition, formFieldMap);
}
}
}
});
Expand Down

0 comments on commit 4e7b49b

Please sign in to comment.