Skip to content

fix(portal): keep Android keyboard focus out of content behind a modal - #5305

Open
Priyanshu0007 wants to merge 1 commit into
callstack:mainfrom
Priyanshu0007:fix/dialog-android-keyboard-focus
Open

Priyanshu0007 wants to merge 1 commit into
callstack:mainfrom
Priyanshu0007:fix/dialog-android-keyboard-focus

Conversation

@Priyanshu0007

Copy link
Copy Markdown

Motivation

On Android, Tab reached Paper buttons behind an open Dialog and Enter pressed them. Now each PortalLayer tells its subtree it's behind a modal, and Paper's Pressable sets accessible and focusable to false there (Android only).

Related issue

Fixes #5296

Videos

Before After
Android (fixed)
issue-5296-web-before.mp4
issue-5296-android-before.mp4
iOS (unchanged)
issue-5296-android-after.mp4
issue-5296-ios-before.mp4
Web (unchanged)
issue-5296-ios-after.mp4
issue-5296-web-after.mp4

Test plan

Android + keyboard: open a dialog, press Tab. Focus never lands behind the scrim.

On Android, a hardware keyboard could Tab to Paper's buttons behind an
open Dialog or Modal and press them with Enter. Each portal layer now
tells its subtree whether it sits behind the topmost modal, and Paper's
Pressable sets `accessible` and `focusable` to false there on Android.
Components that used React Native's Pressable directly now use Paper's.

Fixes callstack#5296.
@Doberjohn Doberjohn added this to the 6.1.0 milestone Nov 24, 2026
@Doberjohn

Copy link
Copy Markdown
Collaborator

Thanks for the videos! 6.0 now takes only regressions and major bugs, so this is on the 6.1.0 milestone and gets its review after 6.0.0.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialog: on Android, keyboard focus isn't moved into an open dialog and Tab reaches the screen behind it

2 participants