- Issue created by @rroose
- Assigned to sourav_paul
- Merge request !8695Issue #3459838: Prefix is shown before description โ (Closed) created by sourav_paul
- Issue was unassigned.
- Status changed to Needs review
10 months ago 9:09am 8 July 2024 - ๐ฎ๐ณIndia Kanchan Bhogade
I've Tested MR 8695 on Drupal 10.3.x-dev
MR is applied Successfully...Testing steps:
- Create a Webform with the Webform module.
- Create a 'Number' element.
- Fill in the description.
- Fill in the prefix.
- Set 'Description display' to 'Before'.
- Save the element and view the form.
The Prefix is shown before the Number field instead of before the description.
Attaching SS for reference
RTBC+1Keeping "Needs review" for Code verification
- Status changed to Needs work
10 months ago 2:02pm 8 July 2024 - ๐บ๐ธUnited States smustgrave
MR should be against 11.x branch.
Also probably will need test coverage and definitely a change record.
Recommend steps are updated using just core without a contrib to make sure the bug isn't from contrib.
- Assigned to sourav_paul
- Merge request !8731Issue #3459838: Prefix is shown before description โ (Open) created by sourav_paul
- Issue was unassigned.
- ๐ฎ๐ณIndia Akhil Babu Chengannur
- web/core/profiles/demo_umami/themes/umami/templates/classy/form/form-element.html.twig
- web/core/themes/stable9/templates/form/form-element.html.twig
- web/core/themes/starterkit_theme/templates/form/form-element.html.twig
All these core templates follow the same structure for prefix
{% if prefix is not empty %} <span class="field-prefix">{{ prefix }}</span> {% endif %} {% if description_display == 'before' and description.content %} <div{{ description.attributes }}> {{ description.content }} </div> {% endif %}
Shouldn't we update all of them. Or is it something that should be handled by the 'webform' module itself?
- ๐ณ๐ฑNetherlands rroose
I think we should. I see no valid reason or argument to put the prefix before the description, so it seems like a mistake or bug. The prefix is mostly used to indicate what value the user needs to enter, such as a currency.
- Status changed to Needs review
8 months ago 9:22am 2 September 2024 - Status changed to Needs work
8 months ago 2:42pm 2 September 2024 - ๐บ๐ธUnited States smustgrave
Was previously tagged for tests.
And if a template needs changed then all of them would have to be updated with a change record.
- Status changed to Needs review
8 months ago 12:18pm 3 September 2024 - Status changed to Needs work
8 months ago 12:41pm 3 September 2024 - ๐บ๐ธUnited States smustgrave
Also has anyone gone through the git history for when this was added to see if done on purpose?
- ๐ฎ๐ณIndia sourav_paul Kolkata
From a non-developer perspective, it's a bug as it feels no purpose to put the prefix before the description but, if we put the prefix below the description, it looks quite meaningful as the prefix is mostly used to indicate what value the user needs to enter.
I do appreciate with #13
- ๐ฎ๐ณIndia Sahana _N
sahana _n โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia Sahana _N
I Uptaed MR Please review.
I am happy to take suggestions for improvements. Please let me know.
Thank you!! - Status changed to Needs review
8 months ago 11:49am 13 September 2024 - Status changed to Needs work
8 months ago 3:57pm 19 September 2024 - ๐ฎ๐ณIndia sriharsha.uppuluri Hyderabad
sriharsha.uppuluri โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia sourav_paul Kolkata
Could anyone build proper tests & fix pipeline errors?
- First commit to issue fork.
- ๐บ๐ธUnited States dcam
The problem isn't with element
#prefix
keys. Those are displayed outside of the element's wrapper. The problem is with the#field_prefix
key, which is supposed to be inline with the input element.The test has been corrected to demonstrate the actual problem. The issue summary has been updated.
Also has anyone gone through the git history for when this was added to see if done on purpose?
The field prefix was part of the original port of the form-element template into Twig. It was rendered adjacent to the input element which should be considered as the appropriate position. That's why the field prefix is rendered inside a
<span>
. The ability to move the description before input elements wasn't added until later in #314385: Make position of #description configurable via the API โ . A search of that issue for "prefix" doesn't show any consideration for the position of the field prefix in relation to the description. Due to this, I think it's clear that this is unintended behavior and a bug. - ๐บ๐ธUnited States dcam
Change record: https://www.drupal.org/node/3523777 โ