Skip to content

fix(checkbox,radio,toggle): add missing keyboard focus indicators#31295

Open
ShaneK wants to merge 2 commits into
mainfrom
FW-7585-FW-7586
Open

fix(checkbox,radio,toggle): add missing keyboard focus indicators#31295
ShaneK wants to merge 2 commits into
mainfrom
FW-7585-FW-7586

Conversation

@ShaneK

@ShaneK ShaneK commented Jul 24, 2026

Copy link
Copy Markdown
Member

Issue number: internal


What is the current behavior?

Currently, ion-checkbox and ion-toggle never show a keyboard focus indicator. ion-checkbox doesn't set the ion-focusable class and has no focus styles in the ios or md themes, so it can't receive the ion-focused class or render a ring. ion-toggle's only focus rule (:host(.ion-focused) input) targets the native input, which is display: none, so it never renders.

Separately, ion-checkbox, ion-radio, and ion-toggle show no focus indicator inside an ion-item that holds more than one input. ion-checkbox and ion-radio disable their own indicator in an item on the assumption the item draws one, but a multi-input item has no cover to highlight, so nothing is focused.

What is the new behavior?

ion-checkbox now sets ion-focusable when it isn't deferring to an item, with matching ios and md focus styles, so a standalone checkbox shows the same indicator ion-radio already did. Both ion-checkbox and ion-radio also become focusable inside a multi-input item, detected through the item's item-multiple-inputs class, so each control shows its own indicator when the item can't.

ion-toggle always shows its own indicator. Unlike checkbox and radio, it's excluded from the item's input cover, so an item never highlights on its behalf, in or out of a multi-input item. Its dead input focus rule is replaced with a ring on the visible track in both themes.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Preview checkbox:

Preview toggle:

Preview radio:

@ShaneK
ShaneK requested a review from a team as a code owner July 24, 2026 18:01
@ShaneK
ShaneK requested a review from gnbm July 24, 2026 18:01
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Jul 24, 2026 6:01pm

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Jul 24, 2026

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! My main feedback is we should be hiding the browser's native focus ring.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these styles from radio for ios:

Image

It looks way better without them:

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to remove the large outline that appears in the browser on focus:

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to remove the large outline that appears in the browser on focus:

Image

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

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants