AdvancedCustomFields / AdvancedCustomFields/acf
Incorrect use of <label for=FORM_ELEMENT>
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Chrome DevTools indicates, that some ACF fields has issue, that generated field HTML has label with for attribute, that has no related element with same id, for example:
- Checkbox
- File Input
- Tabs
To Reproduce
Steps to reproduce the behavior:
- Create ACF fields group with type checkbox.
- Go to post edit page.
- Open DevTools Issues tab (if not shown click red icon with number on top right corner on the left of Settings icon).
- See error
Expected behavior
- Attribute
formust be removed when is not applicable. - Attribute
formust haveidtarget to File input.
Screenshots or Video
Version Information:
- WordPress Version 6.8.1
- PHP Version 8.3.6
- ACF Version ACF PRO 6.4.0.1
- Browser Chrome 135
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the issue in the post edit page with Checkbox, File Input, and Tabs fields, then inspect their generated HTML and Chrome DevTools Issues tab. Update the affected markup so labels either omit an inapplicable for attribute or target an existing file-input id; done means the reported label errors no longer appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- accessibility
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100