When using node/add form using Bootstrap5's theme, the input boxes .form-control are using display:block and
<li></li>
</ol>>width:100%
which makes the prefix/suffix elements of a form to get wrapped in new lines instead of the same line.
A simple proposed fix would be to make use of bootstrap's input-group classes in form-element.html.twig:
{% if prefix is not empty or suffix is not empty %}
<div class="input-group">
{% if prefix is not empty %}
<span class="input-group-text">{{ prefix }}</span>
{% endif %}
{{ children }}
{% if suffix is not empty %}
<span class="input-group-text">{{ suffix }}</span>
{% endif %}
</div>
{% else %}
{{ children }}
{% endif %}
Difference is in the attached photos. (before and after)
Steps to Reproduce:
- Create a Node with fields
- Add a field that has a prefix/suffix
- Access the node/add form using bootstrap5 theme, not admin. The fields will be broken
Comments
Comment #2
iaacristobalComment #3
iaacristobalComment #4
jannakha commentedplease create MR with attache before patch and after patch screenshots/produced output
Comment #8
iaacristobalComment #9
iaacristobalComment #10
jannakha commentedthank you for your contribution!
fix works!
please release!
Comment #11
vladimirausThank you. Committed.