Read a label whose for names no element as its field wrapper's positional label
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
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
fornames a different existing element is still not claimed positionally. - A wrapper shared by two controls still yields no positional label.
composer test:canonicalpasses.
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#2161 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/blocks-engine#2061 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#1701 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
Automattic/blocks-engine#3371 ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
Awaiting Triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/opencode#58664 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 87/100
WordPress/phpunit-test-runner#364 ·
Maintainers usually reply within 4 days
-
domain/framework Platform(Default) priority/high
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days