Skip to content

Keep focusable={false} Android images out of keyboard navigation - #60172

Open
lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-60168-image-focusable
Open

lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-60168-image-focusable

Conversation

@lazerg

@lazerg lazerg commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary:

On Android, an accessible Image still takes hardware-keyboard focus with focusable={false} or tabIndex={-1}. setAccessible sets isFocusable, which keyboard navigation also reads, and ReactImageManager had no focusable setter, so the prop did nothing. Image.android.js also never turned tabIndex into focusable the way View does.

ReactImageManager now handles focusable, and ReactImageView leaves itself out of addFocusables and refuses requestFocus when it is false. isFocusable stays tied to accessible, so TalkBack still reaches the image. A focused image stays a candidate so focus can move on from it. Image.android.js maps tabIndex to focusable like View.js. This is the Image side of #59048 (View) and #59139 (Text).

Fixes #60168

Changelog:

[ANDROID] [FIXED] - focusable={false} and tabIndex={-1} take an accessible Image out of hardware-keyboard navigation

Test Plan:

Added testFocusableFalseKeepsAccessibleImageOutOfKeyboardFocus to ReactImagePropertyTest. It sets accessible and focusable={false} through updateProperties, then checks that addFocusables adds nothing, requestFocus fails and isFocusable stays true, and that focusable={true} makes the image a candidate again. It fails on main and passes with the change.

./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest -Preact.internal.useHermesStable=true

The full ReactAndroid unit test suite passes, and format-check-kotlin, ESLint, Prettier and flow full-check are clean. I didn't run the reproducer on a device.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 20, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 20, 2026

This branch has not been deployed

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: an accessible Image takes hardware-keyboard focus even with focusable={false} or tabIndex={-1}

1 participant