Problem/Motivation
When using the field widget to add an entity to multiple groups there is an issue with how the form is displayed after being added to the first group.
When the form loads - it displays correctly:

When the first group is added, the form renders strangely. The button is stretched the full height and the width of the dropdown is compacted with no spacing between the button and the dropdown.

Steps to reproduce
- Add the field widget to a form, allow multiple
- Add the entity to a group
Proposed resolution
This issue is the CSS coming from Claro - but I don't know if its technically a bug for claro or entitygroupfield? It could be resolved by adding some additional rules to the existing admin CSS to target the form when it is rendered in the field actions wrapper - but I don't know what impact that would have on other admin theme.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork entitygroupfield-3424179
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3424179-display-issue-when
changes, plain diff MR !14
Comments
Comment #3
ericgsmith commentedNot an expert on flex / the front end - but claro was setting the field actions and form wrapper as display flex - when the form is rendered without first adding to the group the wrappers are just normal divs.
There is likely a more elegant way to style this when using flex - but given not all admin themes will be doing this, it seems safer to just set these back to block within the scope of the widget?
Not sure, it works on claro but I haven't tests on any other admin themes.
Comment #5
naveenvalechaThanks for the PR
I have tested it on a customer project. It works with the claro. I have replaced the css selector with genric one.
Comment #7
carsoncho commentedThis was mostly working, but we're using autocomplete widget so I've modified the selector to also target the autocomplete widget as well. Additionally, I added an align-self to fix the group listing title to also be centered.
Comment #8
introfini commentedThanks for the patch. It fixes the issue in Claro and Gin.
Comment #10
dwwThanks for the report and the fix! Confirmed the bug. Tested with both claro and seven. The new CSS doesn't break seven, and fixes claro. Rebased the MR to get working GitLab pipelines again. Pushed a few commits to make the stylelint job happy. Once the pipeline is green, I'll be merging this.
Comment #14
dwwMerged. Thanks, y'all!