Skip to content

fix(tab-button): apply correct focused background color in dark palette#31050

Open
gnbm wants to merge 3 commits intomainfrom
FW-6293
Open

fix(tab-button): apply correct focused background color in dark palette#31050
gnbm wants to merge 3 commits intomainfrom
FW-6293

Conversation

@gnbm
Copy link
Copy Markdown
Contributor

@gnbm gnbm commented Mar 30, 2026

Issue number: resolves resolves internal


What is the current behavior?

In the dark palette, focused ion-tab-button elements do not receive the ion-focused class, so the focus indicator is never shown.
The --ion-tab-bar-background-focused token was also not set, causing the focused state to fall back to get-color-shade(#fff) (#e0e0e0) — a light grey that is invisible on a dark background.

What is the new behavior?

  • --ion-tab-bar-background-focused is defined in the dark palette: #0b0b0b for iOS and #1b1b1b for MD, providing a subtle dark-appropriate focus indicator.
  • A new e2e test verifies that the focused ion-tab-button receives the ion-focused class and does not render with the light-mode fallback color in the dark palette.

Does this introduce a breaking change?

  • Yes
  • No

Other information

The test triggers keyboard mode (required by focus-visible.ts) before focusing the inner <a> element inside the tab button's shadow DOM, since calling .focus() on the host element is a no-op without delegatesFocus.

@gnbm gnbm added package: core @ionic/core package type: bug a confirmed bug report labels Mar 30, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Mar 30, 2026 10:10pm

Request Review

@gnbm gnbm marked this pull request as ready for review March 30, 2026 22:20
@gnbm gnbm requested a review from a team as a code owner March 30, 2026 22:20
@gnbm gnbm requested a review from brandyscarney March 30, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package type: bug a confirmed bug report

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants