fix: android pressability issue with measureAsyncOnUI patch#86160
Conversation
Add react-native patch based on upstream PR react/react-native#51835 to fix Android-specific issue where onPress events do not trigger for Pressable components when used inside a Tooltip on certain Samsung devices. Also removes the createPressHandler workaround since this patch properly fixes the root cause. Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot We're seeing the error _NativeDOM.default.measureAsyncOnUI is not a function on iOS. |
🔍 Analysis:
|
|
@MelvinBot please apply the fix |
… methodMap_ On iOS, codegen for FBReactNativeSpec is skipped when pre-generated files exist in node_modules. The original patch modified NativeDOM.js and the C++ implementation but did not update the pre-generated FBReactNativeSpecJSI.h, causing measureAsyncOnUI to be undefined at runtime on iOS. This commit: 1. Patches FBReactNativeSpecJSI.h to add measureAsyncOnUI to the NativeDOMCxxSpec methodMap_ and adds the static invoker function 2. Adds a defensive typeof guard in ReactNativeElement.measureAsyncOnUI to fall back to regular measure() if the native method is unavailable Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
|
Fixed the iOS Changes:
Please rebuild the iOS app and verify the error is resolved. |
|
@MelvinBot The workflows failing |
The second hunk of the FBReactNativeSpecJSI.h section had a line count mismatch in its @@ header (declared 6 old/15 new but only contained 5 old/14 new lines), causing patch-package to fail with a parse error during npm postinstall. Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
|
Fixed the failing checks: the |
|
I checked the workflow status. The only failing check is All other checks (ESLint, typecheck, tests, builds, etc.) are still pending — they're currently running. There are no actual failures to fix yet. If any checks fail after they complete, feel free to tag me again and I'll investigate. |
|
The previous check failures (TypeScript, ESLint, unused styles) were all caused by the same issue: the patch file This was already fixed in commit The only failing check is |
|
🚧 @MonilBhavsar has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@MelvinBot Please make this PR ready for review! |
|
I attempted to mark this PR as ready for review, but the command was blocked by my permission settings. You can mark it ready yourself using the GitHub UI (click "Ready for review" at the bottom of the PR) or by running: Reminder: There is a known iOS issue ( |
|
@MelvinBot Please mark it as "Ready for review" |
|
@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
PR has been marked as Ready for review as requested. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-03-25.16.32.23.mp4Android: mWeb ChromeScreen.Recording.2026-03-25.at.16.34.35.moviOS: HybridAppScreen.Recording.2026-03-25.at.16.31.43.moviOS: mWeb SafariScreen.Recording.2026-03-25.at.16.32.55.movMacOS: Chrome / SafariScreen.Recording.2026-03-25.at.16.35.11.mov |
|
@MelvinBot Please complete PR Author Checklist |
linhvovan29546
left a comment
There was a problem hiding this comment.
NAB: #86160 (comment)
|
All checks on this PR are currently passing. There are no failing checks to fix — every check shows either |
|
🚧 @Valforte has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Valforte in version: 9.3.50-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This PR is an internal bug fix that patches React Native's native touch measurement system (
There are no changes to user-facing features, workflows, UI labels, settings, or product behavior that would require documentation updates in |
|
Hi @MelvinBot. Unfortunately, the QA team doesn’t have a Samsung Galaxy Z Fold 4 or a similar affected device. How can we test this in that case? |
|
@IuliiaHerets Just a Samsung device |
|
@linhvovan29546 QA team tried with 2 Samsung devices. Please let me know if this result can be considered a pass. WhatsApp.Video.2026-03-28.at.9.14.46.AM.mp4MicrosoftTeams-video.34.mp4 |
|
@IuliiaHerets yes |
|
@MelvinBot The PR was reverted, please open a new PR containing the same changes. |
|
🤖 New draft PR created: #86707 This contains the same changes as this PR, re-applied on top of current |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.3.50-8 🚀
|
Re-apply the changes from PR #86160 which was reverted. Adds a react-native patch based on upstream react/react-native#51835 to fix onPress events not triggering for Pressable components inside Tooltips on certain Samsung devices. Also removes the createPressHandler workaround since this patch properly fixes the root cause.
Explanation of Change
This PR adds a
react-nativepatch based on the upstream PR facebook/react-native#51835 to fix an Android-specific issue whereonPressevents do not trigger forPressablecomponents when used inside aTooltipon certain Samsung devices.Root Cause: In the new architecture,
Pressability.measure()reads layout information from the shadow tree. When a tooltip uses a Reanimated animation (e.g.,scale: 0during entry), the shadow tree retains the stale value while the UI thread has already updated. This causesPressabilityto incorrectly compute the pressable region as having zero size, making the button untappable.Fix: Introduces a new
measureAsyncOnUImethod that measures views using the native view hierarchy on the UI thread instead of the shadow tree. This ensures correct measurements even when Reanimated has modified the view's transform on the native side.The patch modifies:
Pressability.jsto callmeasureAsyncOnUIinstead ofmeasure; addsmeasureAsyncOnUItoFabricUIManager,ReactFabricHostComponent,ReactNativeElement, and type definitionsmeasureAsyncOnUIbinding inUIManagerBinding.cpp, with delegation throughUIManagerDelegate→Scheduler→SchedulerDelegateRCTMountingManagerusingRCTExecuteOnMainQueuewith native view hierarchy measurementFabricUIManager→MountingManagerusingMountItemdispatch to UI thread, with native view hierarchy measurement via bounding box computationAlso removes the
createPressHandlerworkaround (which usedonPressIninstead ofonPresson Android) since this patch properly fixes the root cause.Fixed Issues
$ #59953
Tests
Offline tests
Same as tests - tooltip dismissal is a local UI interaction and should work identically offline.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
This bug requires a specific Samsung device (e.g., Galaxy Z Fold 4) to reproduce. The patch is based on the upstream react-native fix.
Android: mWeb Chrome
N/A - This is a native-only issue (Fabric/new arch)
iOS: Native
N/A - This is an Android-specific issue
iOS: mWeb Safari
N/A - This is an Android-specific issue
MacOS: Chrome / Safari
N/A - This is an Android-specific issue