Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Read a label whose for names no element as its field wrapper's positional label

Open Beginner friendly
#3,369 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start in FormControlLabel::fieldWrapperLabel() and inspect how it handles labels with a for attribute and resolves that value in the owner document. Add or update unit fixtures for a dangling for, one that resolves to another element, and a wrapper with two controls. Done means the dangling label associates with the input, the other two cases remain unclaimed, and composer test:canonical passes.

Written by the indexing model from the issue text.

Description

Problem

A <label for="X"> whose for names no element in the document is left unassociated, even when it is the only label beside the only control in its field wrapper:

<div class="field"><label for="Name">Name *</label><input type="text" name="name" id="name"></div>

(for matching is case-sensitive, so Name ≠ name.) FormControlLabel::fieldWrapperLabel() already reads the positional association "one label, one control, same wrapper", but only for labels with no for attribute. A dangling for states no association either, so it should be read the same way. Today the caption drops to description copy: static-site-importer emits it as Jetpack help text rendered below the input in a different size and colour, and the field's label becomes the input name. Seen on every One.com contact form (hr-nordic.com).

Proposal

In fieldWrapperLabel(), treat a label whose for resolves to no element in the owner document like a label without for. A for that resolves to some other element still opts out.

Acceptance

  • A unit fixture with the markup above associates Name * with the input.
  • A label whose for names a different existing element is still not claimed positionally.
  • A wrapper shared by two controls still yields no positional label.
  • composer test:canonical passes.

AI disclosure: drafted by Franklin (Claude, via the Pi coding agent) from a reduced fixture of the hr-nordic.com import; Chris Huber directs the work.

Dominant language
PHP
Stars
22
Forks
2
Avg merge
7h 48m
Merged PRs (30d)
688

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.