From 9ff1d24cd0e85442739643f79ac90c6dd2e93e7a Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Sat, 24 Oct 2026 00:18:16 +0200 Subject: [PATCH 1/3] Menu: Show focus on disabled UI items --- packages/ui/CHANGELOG.md | 1 + packages/ui/src/menu/style.module.css | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index b08a68715ca265..841b5c617d2962 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -19,6 +19,7 @@ ### Bug Fixes - `ControlWithError`: Fix dropped keystrokes under React 19 caused by a state update after every render ([#85479](https://github.com/WordPress/gutenberg/pull/85479)). +- `Menu`: Show a focus ring on disabled menu items when they receive keyboard focus ([#84583](https://github.com/WordPress/gutenberg/pull/84583)). ### Documentation diff --git a/packages/ui/src/menu/style.module.css b/packages/ui/src/menu/style.module.css index 164c0c28b3dd22..426e7a083b2478 100644 --- a/packages/ui/src/menu/style.module.css +++ b/packages/ui/src/menu/style.module.css @@ -206,6 +206,13 @@ background-color: var(--wpds-color-background-interactive-neutral-weak-disabled); color: var(--wpds-color-foreground-interactive-neutral-disabled); + &:focus { + --_gcd-div-outline: var(--wpds-border-width-focus) solid var(--focus-color, var(--wpds-color-stroke-focus)); + --_gcd-a-outline: var(--_gcd-div-outline); + + outline-offset: 0; + } + @media ( forced-colors: active ) { --_gcd-a-color: GrayText; From f3f68499070c4d00a2dd2ced61331046137ea715 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Sat, 24 Oct 2026 00:19:13 +0200 Subject: [PATCH 2/3] Fix UI disabled menu focus changelog reference --- packages/ui/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 841b5c617d2962..6812ea8d65ba96 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -19,7 +19,7 @@ ### Bug Fixes - `ControlWithError`: Fix dropped keystrokes under React 19 caused by a state update after every render ([#85479](https://github.com/WordPress/gutenberg/pull/85479)). -- `Menu`: Show a focus ring on disabled menu items when they receive keyboard focus ([#84583](https://github.com/WordPress/gutenberg/pull/84583)). +- `Menu`: Show a focus ring on disabled menu items when they receive keyboard focus ([#85488](https://github.com/WordPress/gutenberg/pull/85488)). ### Documentation From 3b0ab26f2f199c3a977b705fcf6f93f1af1caa58 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Tue, 27 Oct 2026 12:01:06 +0000 Subject: [PATCH 3/3] Menu: Use highlighted state for disabled item focus rings --- packages/ui/CHANGELOG.md | 2 +- packages/ui/src/menu/style.module.css | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 6812ea8d65ba96..b1a3ab2d3fabcb 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -19,7 +19,7 @@ ### Bug Fixes - `ControlWithError`: Fix dropped keystrokes under React 19 caused by a state update after every render ([#85479](https://github.com/WordPress/gutenberg/pull/85479)). -- `Menu`: Show a focus ring on disabled menu items when they receive keyboard focus ([#85488](https://github.com/WordPress/gutenberg/pull/85488)). +- `Menu`: Show a focus ring on highlighted disabled items ([#85488](https://github.com/WordPress/gutenberg/pull/85488)). ### Documentation diff --git a/packages/ui/src/menu/style.module.css b/packages/ui/src/menu/style.module.css index 426e7a083b2478..30be88c87eec4d 100644 --- a/packages/ui/src/menu/style.module.css +++ b/packages/ui/src/menu/style.module.css @@ -206,11 +206,9 @@ background-color: var(--wpds-color-background-interactive-neutral-weak-disabled); color: var(--wpds-color-foreground-interactive-neutral-disabled); - &:focus { + &[data-highlighted] { --_gcd-div-outline: var(--wpds-border-width-focus) solid var(--focus-color, var(--wpds-color-stroke-focus)); --_gcd-a-outline: var(--_gcd-div-outline); - - outline-offset: 0; } @media ( forced-colors: active ) {