Problem/Motivation

Given there is no label, there is no required marker, even though the field is set to mark required.

Steps to reproduce

  1. Add a Name field to a content type and mark the field as required.
  2. 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).
  3. Set at least one text component’s Title display to placeholder (and optionally one to hidden/none).
  4. 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

Hidden before change
Placeholder before change

After

Hidden after change
Placeholder after change

API changes

Data model changes

Issue fork name-3562730

Command icon 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

jcandan created an issue. See original summary.

jcandan’s picture

Untested, but this is likely true of hidden as well.

aryan singh’s picture

Working on this...

aryan singh’s picture

Status: Active » Needs review

I have raised a MR that solves the issue for placeholder and also for hidden.
Thanks @jcandan for mentioning that.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 8.x-1.x to hidden.

bluegeek9’s picture

Issue summary: View changes
bluegeek9’s picture

bluegeek9’s picture

Issue summary: View changes

bluegeek9’s picture

Status: Needs review » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • b0268f7a committed on 8.x-1.x
    feat: #3562730 Placeholder label display setting has no front-end...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.