Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Fix: Lexical Fields use "undefined" for name in css label element attribute "for=" #10034

Closed
n-a-t-j-b opened this issue Dec 18, 2024 · 2 comments · Fixed by #10036
Closed
Labels
area: ui Related to the admin panel.

Comments

@n-a-t-j-b
Copy link

Describe the Bug.

Typically fields have a label with the css "for" attribute so that styling can be precise. When using labels on Lexical fields however the attribute is for="field-undefined" even when a label is explicitly declared:

<label class="field-label " for="field-undefined">Introduction</label>

Image

versus the norm (author in this example) which is for="field-(insert field name here)":

<label class="field-label " for="field-author">Author<span class="required">*</span></label>

Image

Reproduction Steps

Create a richText field in your config (with or without a label element):

{
  name: 'intro',
  label: 'Introduction',
  type: 'richText',
},

Inspect the output of the Admin Panel for that field using dev tools.

Expect to see:

<label class="field-label" for="field-intro">Introduction</label>

But instead you get:

<label class="field-label" for="field-undefined">Introduction</label>

Environment Info

Payload: 3.7.0
Node.js: 20.15.0
Next.js: 15.1.0
@n-a-t-j-b n-a-t-j-b added area: ui Related to the admin panel. status: needs-triage Possible bug which hasn't been reproduced yet labels Dec 18, 2024
@n-a-t-j-b n-a-t-j-b changed the title UI Fix: Lexical Fields use "undefined" for name in css label element property "for=" UI Fix: Lexical Fields use "undefined" for name in css label element attribute "for=" Dec 18, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 18, 2024
Copy link
Contributor

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2024
Copy link
Contributor

🚀 This is included in version v3.10.0

@github-actions github-actions bot unlocked this conversation Dec 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: ui Related to the admin panel.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant