Skip to content

fix(checkbox): clear the focus ring when onPress is removed - #5223

Merged
Doberjohn merged 1 commit into
mainfrom
fix/checkbox-stale-focus-ring
Nov 16, 2026
Merged

Doberjohn merged 1 commit into
mainfrom
fix/checkbox-stale-focus-ring

Conversation

@Doberjohn

Copy link
Copy Markdown
Collaborator

Motivation

On Android, a keyboard-focused Checkbox that loses and regains onPress shows its focus ring with nothing focused.

Without a handler, TouchableRipple renders a plain View, so the focused Pressable is destroyed and its blur never reaches JS. Checkbox's reset effect for that case cleared hover and press, but not its own focused state. It now clears that too.

Related issue

None. Follows #5071 and #5107.

Screenshots / Videos

Not visual on its own; the test covers it.

Test plan

  • New "Checkbox focus ring" tests in Checkbox.test.tsx: they fail without the fix and pass with it.
  • Optional: Android with a hardware keyboard, example app's Checkbox screen: focus, drop and restore the handler, no ring.

On Android, a keyboard-focused Checkbox that loses and regains `onPress` shows its ring with nothing focused.
The destroyed Pressable never sends a blur, and the reset effect cleared hover and press state but not focus.
@github-actions

Copy link
Copy Markdown

Found potential problems with the pull request:

  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

@Doberjohn
Doberjohn merged commit 8787d4b into main Nov 16, 2026
15 checks passed
@Doberjohn
Doberjohn deleted the fix/checkbox-stale-focus-ring branch November 16, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant