Skip to content

fix accessbility issues#830

Merged
georgestephanis merged 1 commit intoWordPress:masterfrom
masteradhoc:accessibility-fixes
Mar 18, 2026
Merged

fix accessbility issues#830
georgestephanis merged 1 commit intoWordPress:masterfrom
masteradhoc:accessibility-fixes

Conversation

@masteradhoc
Copy link
Copy Markdown
Collaborator

What?

Fix two accessibility issues in the Two-Factor settings UI.

Why?

  • The "Primary Method" <select> had no programmatically associated label, failing WCAG 1.3.1.
  • The <fieldset id="two-factor-options"> had no <legend>, leaving screen readers without a group description for the contained controls.

How?

  • Wrapped the "Primary Method" <th> text in <label for="two-factor-primary-provider"> and added the matching id to the <select>.
  • Added <legend class="screen-reader-text">Two-Factor Options</legend> as the first child of the fieldset. The screen-reader-text class keeps it visually hidden since the <h2> above already provides the visible heading.

Testing Instructions

  1. Open a user profile page with Two-Factor active.
  2. Run an automated a11y scan (e.g. Axe, WAVE) — "select has no label" and "fieldset has no legend" errors should be gone.
  3. Navigate with a screen reader (VoiceOver/NVDA) — the primary method select should announce "Primary Method" and each checkbox within the fieldset should be preceded by "Two-Factor Options".

Changelog Entry

Fixed - "Primary Method" select and Two-Factor Options fieldset were missing accessible labels for screen readers.

@masteradhoc masteradhoc added this to the 0.16.0 milestone Mar 11, 2026
@masteradhoc masteradhoc self-assigned this Mar 11, 2026
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: masteradhoc <masteradhoc@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@georgestephanis georgestephanis merged commit 04e80a5 into WordPress:master Mar 18, 2026
29 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Two Factor project board Mar 18, 2026
@masteradhoc masteradhoc deleted the accessibility-fixes branch March 18, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants