Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#66271 new defect (bug)

Make sure aria-disabled buttons use a consistent focus style

Reported by: afercia Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version:
Severity: normal Keywords: has-patch
Cc: Focuses: accessibility

Description

Splitting this out from #66038.
See comment at ​https://github.com/WordPress/wordpress-develop/pull/13390/#issuecomment-6061122370

Now that Core is going to use more and more the pattern already used on Gutenberg where disabled controls use aria-disabled="true" instead of a disabled attribute, the styles that come from buttons.css, colors.css, and potentially other stylesheets should be adapted to ensure the aria-disabled buttons get a consistent focus style.

Reminder: using aria-disabled="true":

  • Helps making controle discoverable, for better general usability.
  • Helps preventing focus losses when controls are disabled, as they are still focusable.

Change History (1)

This ticket was mentioned in ​PR #14158 on ​WordPress/wordpress-develop by ​@nhrrob.


4 weeks ago
#1

  • Keywords has-patch added

Restores the focus ring on aria-disabled="true" buttons that also have the .disabled class, which currently removes it via box-shadow: none !important.

Testing instructions

  1. On any admin screen, add via dev tools: <div class="wp-core-ui"><button type="button" class="button button-primary disabled" aria-disabled="true">Primary</button> <button type="button" class="button disabled" aria-disabled="true">Secondary</button></div>
  2. Tab to each button.
  3. Before: no focus indicator. After: the standard focus ring.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Drafting the CSS change and verifying it with Playwright; reviewed and tested by me.

Note: See TracTickets for help on using tickets.