Skip to content

Store original focusability when disabling focus - #60412

Closed
PreetamPatidar wants to merge 1 commit into
react:mainfrom
PreetamPatidar:patch-1
Closed

PreetamPatidar wants to merge 1 commit into
react:mainfrom
PreetamPatidar:patch-1

Conversation

@PreetamPatidar

Copy link
Copy Markdown

Summary:

Updates disableFocusForSubtree() to preserve a view's original focusability state before setting view.isFocusable to false.

Previously, disabling focusability without saving the original state could cause the view's previous focusability value to be lost. This change stores the original value using R.id.original_focusability before disabling focus, allowing it to be restored later when accessibility-order handling is removed.

Changelog:

[ANDROID] [FIXED] - Preserve the original focusability state before disabling focus for views excluded from the accessibility order.

Test Plan:

  • Verify that the original focusability value is stored before setting view.isFocusable to false.
  • Verify that an already stored original focusability value is not overwritten.
  • Verify that focusability is restored correctly when accessibility-order handling is removed.
  • Run relevant Android tests.
  • Run Android Kotlin compilation.

Store the original focusability state before disabling it.
@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 30, 2026
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 30, 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 30, 2026
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. Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. 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.

1 participant