It seems that enabling "collapsed by default" for a multi-valued entity reference field causes the inline entity form widget to collapse whenever the form is updated, except for two situations:
- Clicking "Add new item" for the first inline entity in the form.
- Clicking "Add existing item" for the first inline entity in the form.
Steps to Reproduce
- Create a content type that has an entity reference field.
- Configure the entity reference field to use the "Complex" IEF widget.
- Configure the widget with the following enabled:
- Collapsible.
- Collapsed by default.
- Allow users to add new entities.
- Allow users to add existing entities.
- Open the content creation form for the content type created in step 1.
- Expand the collapsed fieldset for the field created in step 2.
- Click "Add new item" on the field created in step 2.
- Fill out the form and click the "Save" button inside the IEF form (i.e. not the one for the whole form, just the one for the child form).
- Do any of the following:
- Click "Edit" next to the item that was added in step 7; OR
- Click "Remove" next to the item that was added in step 7; OR
- Click "Add new item"; OR
- Click "Add existing item"
Expected Results
The fieldset should stay open after step 5.
Actual Results
The fieldset is open for steps 5-7, but then closes after every action attempted in step 8. This makes it difficult for users to:
- add or select multiple inline entities in the same session (since the fieldset closes every time you click a button in the form after the first item has been added)
- remove inline entities (since they can easily miss the confirmation message that is rendered but hidden inside the collapsed fieldset)
Comments
Comment #2
dawid_nawrot commentedYep, I can confirm it, the issue is there and using this option as is doesn't make any sense right now.
Comment #3
ocastle commentedI think this should fix the issue.
Comment #4
pankaj.singh commentedComment #5
pankaj.singh commented@ocastle, thanks for the patch. It works on my end. Tested the patch on 8.9.
Inline Entity form featured options now stays open in all the following activities:
Comment #6
joel_osc commentedPatch is working for me, thank-you @pankaj.singh!
Comment #7
jproctorThis is a duplicate of #2994001: Collapsed by default complex widget closes when trying to edit reference, which was fixed in 8.x-1.0-rc9