Problem/Motivation
Given there is no label, there is no required marker, even though the field is set to mark required.
Steps to reproduce
- Add a Name field to a content type and mark the field as required.
- Manage field → open the settings:
- Turn on Show component required marker (if you care about “(Required)” in placeholder).
- Turn on Flags inputs as required (this is what the patch wires up for placeholder/none).
- Set at least one text component’s Title display to placeholder (and optionally one to hidden/none).
- Open Create node form:
- Inspect the inputs: you should see the required attribute (and browser validation) when Flags inputs as required is on, after the patch.
- With the marker setting on, placeholder text should still include (Required) where applicable.
Proposed resolution
Add `required="required"` to the sub fields
Remaining tasks
User interface changes
Before


After


API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | issues-3562730-hidden-after.png | 14.76 KB | bluegeek9 |
| #9 | issues-3562730-placeholder-after.png | 24.98 KB | bluegeek9 |
| #9 | issues-3562730-hidden-before.png | 10.16 KB | bluegeek9 |
| #9 | issues-3562730-placeholder-before.png | 20.73 KB | bluegeek9 |
Issue fork name-3562730
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:
Comments
Comment #2
jcandan commentedUntested, but this is likely true of hidden as well.
Comment #3
aryan singh commentedWorking on this...
Comment #5
aryan singh commentedI have raised a MR that solves the issue for placeholder and also for hidden.
Thanks @jcandan for mentioning that.
Comment #8
bluegeek9 commentedComment #9
bluegeek9 commentedComment #10
bluegeek9 commentedComment #12
bluegeek9 commented