Problem/Motivation
The textfield input for "user field" is #required, but has no label (the label is held by the table header) and thus shouldn't have a lone red asterisk. Seven correctly omits the marker if the label is empty.
Example of a form 'multiple, required' field form Bartik :
Seen in #501408: Display user fields on registration form, but is also visible in current HEAD when editing an existing user account with fields.
Beta phase evaluation
Issue category | Bug because the information of the field being required should not appear twice |
---|---|
Issue priority | Major because tim.plunkett said so ;) |
Unfrozen changes | Unfrozen because it only changes markup on fields widget that are set as required and allowing multiple values. |
Prioritized changes | The main goal of this issue is usability and accessibility. Usability by hiding a non-pertinent mark near the input field. Accessibility by providing a valuable label for the multiple input fields. |
Disruption | This change could be disruptive for themes because it forces some form labels to be hidden. |
Proposed resolution
For these cases mark the title_display as hidden:'#title_display' => 'invisible',
Remaining tasks
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Create a patch | Instructions | Done | |
Reroll the patch if it no longer applies. | Novice | Instructions | Done |
Update the issue summary | Instructions | Done | |
Update the issue summary noting if allowed during the beta | Instructions | Done | |
Add automated tests | Instructions | Done | |
Manually test the patch | Novice | Instructions | Done |
Embed before and after screenshots in the issue summary | Novice | Instructions | Done |
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards | Instructions |
User interface changes
Yes, the red asterisk moves to the correct location AND accessibility is enhanced by a better label around the fields.
Before :
<h4 class="label form-required">My unlimited required field label</h4>
[...]<label for="edit-field-unlimited-0-value" class="form-required"></label>
After :
<h4 class="label form-required">My unlimited required field label</h4>
[...]<label for="edit-field-unlimited-0-value" class="visually-hidden form-required">My unlimited required field label (value 1)</label>
API changes
n/a