Skip to content

fix: Button not working with Physical Keyboard#7060

Open
OtavioStasiak wants to merge 7 commits intodevelopfrom
fix.keyboard-button-not-working
Open

fix: Button not working with Physical Keyboard#7060
OtavioStasiak wants to merge 7 commits intodevelopfrom
fix.keyboard-button-not-working

Conversation

@OtavioStasiak
Copy link
Copy Markdown
Contributor

@OtavioStasiak OtavioStasiak commented Mar 19, 2026

Proposed changes

Issue(s)

How to test or reproduce

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

  • Improvements
    • Button component now provides enhanced touch feedback and improved interactive response during user interactions across all platforms.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 19, 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: 4fc60950-ba72-4bb8-a0ee-03b844bf35d3

📥 Commits

Reviewing files that changed from the base of the PR and between b71ee89 and fba20f8.

⛔ Files ignored due to path filters (6)
  • app/containers/Button/__snapshots__/Button.test.tsx.snap is excluded by !**/*.snap
  • app/containers/LoginServices/__snapshots__/LoginServices.test.tsx.snap is excluded by !**/*.snap
  • app/containers/UIKit/__snapshots__/UiKitMessage.test.tsx.snap is excluded by !**/*.snap
  • app/containers/UIKit/__snapshots__/UiKitModal.test.tsx.snap is excluded by !**/*.snap
  • app/containers/message/__snapshots__/Message.test.tsx.snap is excluded by !**/*.snap
  • app/views/CannedResponsesListView/__snapshots__/CannedResponseItem.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • app/containers/Button/Button.test.tsx
  • app/containers/Button/index.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: divyanshu-patil
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6957
File: ios/RocketChat Watch App/Views/MessageComposerView.swift:37-55
Timestamp: 2026-03-04T20:13:17.288Z
Learning: In the WatchOS app (ios/RocketChat Watch App) for Rocket.Chat React Native, using SwiftUI `Button` inside a `ScrollView` on WatchOS causes accidental message sends because button tap targets can be triggered during scroll gestures. `Text` with `.onTapGesture` is the preferred pattern for tappable items in scroll views on WatchOS. To preserve accessibility, add `.accessibilityAddTraits(.isButton)` and `.accessibilityLabel()` to the `Text` element instead.
Learnt from: OtavioStasiak
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6499
File: app/containers/ServerItem/index.tsx:34-36
Timestamp: 2025-12-17T15:56:22.578Z
Learning: In the Rocket.Chat React Native codebase, for radio button components on iOS, include the selection state ("Selected"/"Unselected") in the accessibilityLabel instead of using accessibilityState={{ checked: hasCheck }}, because iOS VoiceOver has known issues with accessibilityRole="radio" + accessibilityState that prevent correct state announcement.
🔇 Additional comments (3)
app/containers/Button/Button.test.tsx (1)

67-67: Good clarification of the Jest limitation.

This comment correctly explains why the disabled-state assertion checks enabled instead of press behavior in this unit test.

app/containers/Button/index.tsx (2)

9-20: Nice prop-surface cleanup for RectButton.

Using Omit<RectButtonProps, 'children' | 'enabled'> plus explicit disabled keeps the API clear and avoids conflicting enable/disable controls.


91-97: Disabled behavior mapping looks correct after the component switch.

enabled={!isDisabled} together with the configured feedback props is consistent with the RectButton migration intent.


Walkthrough

Replaced the underlying button component from Pressable to RectButton from react-native-gesture-handler, updating the component interface and disabled state handling. Updated corresponding test assertions to reflect the new behavior.

Changes

Cohort / File(s) Summary
Button Component
app/containers/Button/index.tsx
Replaced Pressable with RectButton, updated IButtonProps to extend Omit<RectButtonProps, 'children' | 'enabled'>, and added explicit disabled?: boolean prop. Changed disabled behavior from disabled={isDisabled} to enabled={!isDisabled}. Added touch-feedback configuration: activeOpacity={0.2}, underlayColor='transparent', rippleColor='transparent'.
Button Tests
app/containers/Button/Button.test.tsx
Updated disabled-button test assertion comment to reflect that RectButton sets enabled={false} while RNGestureHandlerButton in Jest still triggers onPress. Test behavior remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main fix: replacing Pressable with RectButton to resolve physical keyboard interaction issues. It directly corresponds to the primary change across both modified files.
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.

@OtavioStasiak OtavioStasiak temporarily deployed to approve_e2e_testing March 19, 2026 22:15 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak temporarily deployed to experimental_android_build March 19, 2026 22:21 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak temporarily deployed to experimental_ios_build March 19, 2026 22:21 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown

iOS Build Available

Rocket.Chat Experimental 4.71.0.108409

@OtavioStasiak OtavioStasiak had a problem deploying to upload_experimental_android March 23, 2026 17:51 — with GitHub Actions Error
@github-actions
Copy link
Copy Markdown

Android Build Available

Rocket.Chat Experimental 4.71.0.108408

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNSOhYfhRw_aUIlPeI2m9ZAqQ4NK-kwRvY3h4qKZefvUftzszcPc8Qql_-GNq3R9SsCt6MEWn_MVuXT_YY8h

@OtavioStasiak OtavioStasiak temporarily deployed to approve_e2e_testing March 25, 2026 13:40 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak marked this pull request as ready for review March 25, 2026 13:40
@OtavioStasiak OtavioStasiak requested a deployment to experimental_android_build March 25, 2026 13:44 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak requested a deployment to official_android_build March 25, 2026 13:44 — with GitHub Actions Waiting
@OtavioStasiak OtavioStasiak requested a deployment to experimental_ios_build March 25, 2026 13:44 — with GitHub Actions Waiting
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