Skip to content

Commit

Permalink
bug #5734 Fix the insertion of elements in empty collections (javiere…
Browse files Browse the repository at this point in the history
…guiluz)

This PR was merged into the 4.x branch.

Discussion
----------

Fix the insertion of elements in empty collections

This reverts #5710 as a temporary fix for the issue #5732.

Let's rethink the solution proposed by #5710 to solve this in a different way.

Commits
-------

d921b48 Fix the insertion of elements in empty collections
  • Loading branch information
javiereguiluz committed Apr 27, 2023
2 parents 777233e + d921b48 commit fdcdbb7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/js/field-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EaCollectionProperty = {
.replace(nameRegexp, numItems);

collection.dataset.numItems = numItems;
const newItemInsertionSelector = isArrayCollection ? '.ea-form-collection-items' : '.ea-form-collection-items .accordion > .form-widget-compound [data-empty-collection]';
const newItemInsertionSelector = isArrayCollection ? '.ea-form-collection-items' : '.ea-form-collection-items .accordion > .form-widget-compound';
const collectionItemsWrapper = collection.querySelector(newItemInsertionSelector);

collectionItemsWrapper.insertAdjacentHTML('beforeend', newItemHtml);
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"field-collection": {
"js": [
"/field-collection.a88a5924.js"
"/field-collection.c6a8940b.js"
]
},
"field-file-upload": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Resources/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"field-code-editor.css": "field-code-editor.09574d54.css",
"field-code-editor.rtl.css": "field-code-editor.09574d54.rtl.css",
"field-code-editor.js": "field-code-editor.8988bf27.js",
"field-collection.js": "field-collection.a88a5924.js",
"field-collection.js": "field-collection.c6a8940b.js",
"field-file-upload.js": "field-file-upload.b5f460d6.js",
"field-image.js": "field-image.b7b44654.js",
"field-slug.js": "field-slug.0af8dc08.js",
Expand Down

0 comments on commit fdcdbb7

Please sign in to comment.