fix issue where nested inline panel fix broke inline panel ordering/delete

pull/7718/head
LB Johnston 2021-10-28 11:35:27 +10:00 zatwierdzone przez Matt Westcott
rodzic 3546609a7d
commit 2ff4a62a1b
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -165,7 +165,7 @@ function InlinePanel(opts) { // lgtm[js/unused-local-variable]
// eslint-disable-next-line no-undef
buildExpandingFormset(opts.formsetPrefix, {
onAdd(formCount) {
const newChildPrefix = opts.emptyChildFormPrefix.replace(/__prefix__(.*?['"])/g, formCount + '$1');
const newChildPrefix = opts.emptyChildFormPrefix.replace(/__prefix__/g, formCount);
self.initChildControls(newChildPrefix);
if (opts.canOrder) {
/* NB form hidden inputs use 0-based index and only increment formCount *after* this function is run.