Repository navigation
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +425 B (0%) Total Size: 9.07 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
There was a problem hiding this comment.
🟢 Approval recommended
The scoped selector changes preserve specificity and resting styles, with no unresolved findings.
No open issues 🎉
What changed in this PR
This PR gives keyboard targets visual priority over hovered items in DropdownMenu and Autocomplete, complementing the solid-brand popup styling work.
Changes:
- Adds a shared Sass selector that suppresses competing hover styles without increasing specificity.
- Applies the selector to Button hover rules while preserving resting styles, and documents the fix.
| File | Description |
|---|---|
packages/components/src/utils/popup-item.scss |
Defines the shared keyboard-priority hover selector. |
packages/components/src/button/style.scss |
Applies the selector to existing hover treatments. |
packages/components/CHANGELOG.md |
Records the DropdownMenu and Autocomplete fix. |
Review effort: Balanced
Follow-up to #84583. This PR targets
trunkindependently.What?
Keep the keyboard target visually active when a different popup item is hovered.
Why?
DropdownMenu and Autocomplete can show independent keyboard and hover cues. With solid brand styling, that becomes two identical filled rows.
How?
Filter the existing Button hover selectors when another menu item has focus or another result is selected. A shared Sass selector keeps the same rule in #84583's new brand styles. Both PRs include the identical helper and can merge independently.
Existing resting styles remain intact, including destructive text, pressed rows, custom colors, and color swatches. No reset declarations, interaction state, or public APIs are added.
Testing Instructions
Testing Instructions for Keyboard
Verification
All 111 existing tests across seven files passed on this branch, along with the production build and CSS/changelog lint. CLI browser checks cover the changed styling. The combined preview with #84583 also checks destructive, pressed, and custom-colored rows; color swatches; custom icons; WordPress global CSS; and a dark forced-color palette. No test files or test bodies were added. Real screen readers, touch hardware, and native Windows high-contrast mode were not tested locally.
Screenshots or screencast
Standalone DropdownMenu on trunk, after this change, basic global CSS, 520 × 330.
Before and after with #84583's solid brand treatment
These captures show the combined styling, rather than this branch alone. The right-hand captures include #84583's matching selector changes. Both use the same trunk baseline and a 520 × 330 viewport. Images are cropped without changing the rendered UI.
Use of AI Tools
Implemented, reviewed, and verified with Codex. I reviewed the changes and remain responsible for them.