- Issue created by @marc.bau
- 🇳🇿New Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.
- First commit to issue fork.
- Merge request !94203471459: Fix prefix or suffix not inline with autocomplete field issue → (Closed) created by Unnamed author
- Status changed to Needs review
10 months ago 6:24am 5 September 2024 - 🇮🇳India nayana_mvr
I'm able to reproduce the issue in Drupal core 11.x . Steps followed:-
- Created a new text field and entity reference field with limit 2 in the content type 'Article'
- Created a custom module
- Added 'field_prefix' and 'field_suffix' for both the newly created fields.
- For text field, prefix and suffix are coming as inline but for entity reference it’s not.
Attached screenshots for reference
I tried the suggested solution i.e., changing
width: auto;
for the entity reference input element and it fixes the issue. Also, created an MR for the same.
Noticed that entity reference field without limit doesn’t have 100% width. So making the above changes, both type of entity reference fields will have same width. I'm not sure if that is an issue here.
- Status changed to Needs work
10 months ago 1:23pm 5 September 2024 - Status changed to Needs review
10 months ago 1:56pm 9 September 2024 - 🇮🇳India nayana_mvr
One file was missing in the commit. I have added that and now the build issue is fixed. Kindly review.
- 🇳🇿New Zealand quietone
This is changing the UI so tagging. That got me looking for screenshots. The latest before and after screenshots should be available from the issue summary, in the "User interface changes" to help reviewers. Fortunately, there are only a few comments here so I found that in #9. They look correct but why is there a screenshot of 'tags', https://www.drupal.org/files/issues/2024-09-05/3471459-entity-reference-... → ?
The proposed resolution questions why the value is "100%" and then says that removing it or changing it to 'auto' works. The implemented solution uses 'auto' but there is no discussion of why that option was chosen, nor is there any investigation in to why it is 100%.
This seems like a good thing to have a test for, to prevent regressions.
- 🇮🇳India nayana_mvr
There is one observation :- the issue mentioned in the ticket occurs when Autocomplete widget is used in the form display whether the field is limited or unlimited. If Autocomplete (Tags style) widget is used, then this issue doesn’t occur.
The screenshot of 'tags' was added just to show how an entity reference field with unlimited value + Autocomplete (Tags style) widget looks like in the form. As you can see in the screenshot, the width of that field is not set to100%
. When Autocomplete widget is used, the field appear as a table andwidth: 100%
was set to the input elements and I think it was done so that it will cover the entire row of the table. Attaching a screen recording of entity reference field without prefix/suffix and togglingwidth:100%
.I'm not sure if we can remove
width
completely here. Better to write tests.Updated IS with before and after screenshots.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
The comment in #14 sounds like we have an unintended regression here.
Would it be better to set the parent element that contains the two prefix spans and the form element to display flex, setting flex-grow on the form element. That way it would be 100% if there's no prefix/suffix but otherwise they'd all be on the same line. - 🇮🇳India nayana_mvr
Thanks! @larowlan for the suggestions. I have implemented those changes except
flex-grow
since form element seems to be getting adjusted correctly even withoutflex-grow
because ofwidth:100%
. Below are the changes done in this commit:-- Added display: flex to parent element that contains the two prefix/ suffix spans and the form element
- Reverted width: 100% of form element.
- Added spacing for prefix and suffix referring to the style used for suffix in form.css for screen width above 601px. As I'm not sure why that breakpoint was used in form.css, I added them without breakpoints in table.css
After the above changes this is how the fields looks like and I think it's is much better than previous implementation:
Updating IS screenshots as well.
Please review. - Status changed to RTBC
8 months ago 5:42pm 18 November 2024 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Pinging FE framework managers to confirm they're ok with this.
- 🇺🇸United States bnjmnm Ann Arbor, MI
I checked a few spots with table cells that contain
.form-item
and I saw that in taxonomy term tables the "Status" items are no longer aligned with their header.
Hi @bnjmnm
the issue you mentioned i am unable to reproduce let me know if i am missing something.
step i followed --
1.go to taxonomy
2.click on any list term
3.add 3 terms used one of them to nest inside one term.- 🇮🇳India ahsannazir
ahsannazir → changed the visibility of the branch 3471459-prefixsuffix-not-inline to hidden.
- 🇮🇳India ahsannazir
ahsannazir → changed the visibility of the branch 3471459-prefixsuffix-not-inline to active.
- 🇮🇳India ahsannazir
Removing
justify-content: center
fixes the alignment of Status items. - 🇮🇳India sagarmohite0031
Hello,
Getting error while applying MP.
Attaching error screenshot- - 🇺🇸United States smustgrave
@saurav-drupal-dev there's already a valid set of screenshots on the issue, additional ones aren't needed. Thanks.
- First commit to issue fork.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
19 days ago 8:37pm 26 June 2025 - 🇦🇲Armenia hhvardan
The fix from this issue (commit 937a5478) introducing display: flex on the .form-item seems to be causing some layout regressions elsewhere—specifically with multi-value Link fields.
The details are here ✨ Multi-Link Fields styling applying flex class Active .