Skip to content

fix(button): give buttons a visible keyboard focus indicator - #8314

Draft
talissoncosta wants to merge 2 commits into
mainfrom
fix/button-focus-indicator
Draft

fix(button): give buttons a visible keyboard focus indicator#8314
talissoncosta wants to merge 2 commits into
mainfrom
fix/button-focus-indicator

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

.btn:focus-visible set box-shadow: none, removing Bootstrap's focus ring without putting anything in its place. Every button in the app therefore shows nothing when it takes keyboard focus. Text buttons partly get away with it because .btn-link:focus adds an underline; an icon-only button has no text to underline, so it shows nothing at all, which reads as the button being skipped by Tab.

It came in with #2289, the Bootstrap upgrade, and survived #7402, so it looks like a cosmetic removal of Bootstrap's glow rather than a decision about focus.

Two commits, separable:

  1. The indicator. Replaces the suppressed ring with the outline BareButton already uses (2px solid var(--color-border-action), outline-offset: 2px), so the two primitives agree. WCAG 2.4.7.
  2. :focus to :focus-visible. Focus persists after a mouse click, so :focus left buttons looking pressed until the user clicked elsewhere. This is the change from fix(button): use :focus-visible for hover-bg, drop click-focused dark state #7437, which was closed unreviewed; that branch predates fix(button): centre icons natively, fix hover and disabled states #7402 and no longer rebases cleanly, hence a fresh one. Drop this commit if you would rather keep it separate.

Left alone: .dark .btn-link:focus, which only keeps the background transparent and cannot cause a pressed look.

How did you test this code?

Not yet, which is why this is a draft. It touches every button on every screen, so it wants a visual-regression run and a look at the two cases most likely to clip: icon buttons inside table cells, and buttons in tight flex rows where outline-offset may overlap a neighbour.

Found while reviewing #8044, where an icon-only remove button appeared to be missing from the tab order.

talissoncosta and others added 2 commits August 17, 2026 13:45
`.btn:focus-visible` set `box-shadow: none`, removing Bootstrap's focus ring
without replacing it, so every button in the app showed nothing on keyboard
focus. Text buttons partly got away with it via the underline on `.btn-link`;
icon-only buttons showed nothing at all.

Replaced with the outline BareButton already uses, so the two primitives
agree. WCAG 2.4.7.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Focus persists after a mouse click, so `:focus` left buttons looking pressed
until the user clicked elsewhere. `:focus-visible` limits the styling to
keyboard and programmatic focus. Revives the change from #7437, which was
closed unreviewed; that branch predates #7402 and no longer rebases cleanly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Aug 17, 2026 4:48pm
flagsmith-frontend-staging Ready Ready Preview Aug 17, 2026 4:48pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Aug 17, 2026 4:48pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 284e5696-2799-4d1b-8a72-c83657bf1fa2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant