Skip to content

fix(android): modal focus with physical keyboard on Android#7056

Merged
diegolmello merged 8 commits intodevelopfrom
fix.keyboard-modal-focus
Mar 24, 2026
Merged

fix(android): modal focus with physical keyboard on Android#7056
diegolmello merged 8 commits intodevelopfrom
fix.keyboard-modal-focus

Conversation

@OtavioStasiak
Copy link
Copy Markdown
Contributor

@OtavioStasiak OtavioStasiak commented Mar 17, 2026

Proposed changes

On Android (MasterStackDetails), when a physical keyboard is connected, opening a modal (e.g., RoomInfo or Menu) does not allow it to receive focus.

Issue(s)

https://rocketchat.atlassian.net/browse/MA-267

How to test or reproduce

  • Open the app with keyboard connected;
  • Try to open a menu;
  • Try navigating through the menu using the Tab key;

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Fixed modal presentation behavior on non-iOS platforms to use the native platform-appropriate display style, improving visual consistency across devices.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2960a487-ef82-470f-b909-bbb808a1ad1a

📥 Commits

Reviewing files that changed from the base of the PR and between fef83b0 and 4856021.

📒 Files selected for processing (1)
  • app/stacks/MasterDetailStack/index.tsx
📜 Recent review details
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6970
File: .maestro/tests/room/share-message.yaml:77-79
Timestamp: 2026-03-17T19:15:30.463Z
Learning: In `.maestro/tests/room/share-message.yaml` (Rocket.Chat React Native), the `tapOn: point: 5%,10%` step is intentional: it taps the empty area above the bottom sheet and keyboard to dismiss both simultaneously. Using `action-sheet-handle` instead would only close the sheet but not the keyboard. This pattern is acceptable when both need to be dismissed together in a single step.
📚 Learning: 2026-03-10T15:21:45.098Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7046
File: app/containers/InAppNotification/NotifierComponent.stories.tsx:46-75
Timestamp: 2026-03-10T15:21:45.098Z
Learning: In `app/containers/InAppNotification/NotifierComponent.tsx` (React Native, Rocket.Chat), `NotifierComponent` is exported as a Redux-connected component via `connect(mapStateToProps)`. The `isMasterDetail` prop is automatically injected from `state.app.isMasterDetail` and does not need to be passed explicitly at call sites or in Storybook stories that use the default (connected) export.

Applied to files:

  • app/stacks/MasterDetailStack/index.tsx
🔇 Additional comments (1)
app/stacks/MasterDetailStack/index.tsx (1)

220-220: Good platform-specific presentation split for modal focus.

This keeps iOS transparent modal behavior while switching Android to containedModal, which is consistent with the physical-keyboard focus fix objective.


Walkthrough

Modified the native stack presentation style in MasterDetailStack to conditionally use 'containedTransparentModal' on iOS and 'containedModal' on other platforms, addressing modal navigation behavior on Android.

Changes

Cohort / File(s) Summary
Android Modal Navigation
app/stacks/MasterDetailStack/index.tsx
Changed screenOptions.presentation from static 'containedTransparentModal' to a conditional that selects 'containedTransparentModal' for iOS and 'containedModal' for other platforms.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing modal focus with physical keyboard on Android, which directly addresses the changeset's conditional presentation adjustment for non-iOS platforms.
Linked Issues check ✅ Passed The code change implements a platform-specific fix that addresses the Android keyboard focus issue by changing modal presentation from 'containedTransparentModal' to 'containedModal' on non-iOS platforms, directly resolving MA-267.
Out of Scope Changes check ✅ Passed The changeset contains only one focused modification to the modal presentation style based on platform detection, which is directly scoped to fixing the Android keyboard focus issue without introducing unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

iOS Build Available

Rocket.Chat Experimental 4.71.0.108404

@github-actions
Copy link
Copy Markdown

@OtavioStasiak OtavioStasiak temporarily deployed to approve_e2e_testing March 24, 2026 13:26 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak temporarily deployed to experimental_android_build March 24, 2026 13:29 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak changed the title fix: keyboard focus not working fix(android): modal focus with physical keyboard on Android Mar 24, 2026
@OtavioStasiak OtavioStasiak marked this pull request as ready for review March 24, 2026 13:30
@OtavioStasiak OtavioStasiak had a problem deploying to upload_experimental_android March 24, 2026 14:00 — with GitHub Actions Error
@github-actions
Copy link
Copy Markdown

@OtavioStasiak OtavioStasiak requested a deployment to experimental_ios_build March 24, 2026 17:13 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak requested a deployment to experimental_android_build March 24, 2026 17:13 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak requested a deployment to official_android_build March 24, 2026 17:13 — with GitHub Actions Waiting
@diegolmello diegolmello merged commit b71ee89 into develop Mar 24, 2026
5 of 10 checks passed
@diegolmello diegolmello deleted the fix.keyboard-modal-focus branch March 24, 2026 17:36
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.

2 participants