Fix iOS image picker unresponsive on iOS 18+#83997
Conversation
…n and touch interception Increase setTimeout delay from 200ms to 500ms in AttachmentPicker selectItem() to ensure the native UIViewController hierarchy fully settles on iOS 18+ before presenting PHPickerViewController. Also wrap FullScreenLoadingIndicator with pointerEvents="none" so it doesn't intercept touches while the native picker is active. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| {isLoaderVisible && <FullScreenLoadingIndicator />} | ||
| {isLoaderVisible && ( | ||
| <View | ||
| pointerEvents="none" |
There was a problem hiding this comment.
@MelvinBot can you confirm there's no side effect of this on all platforms?
There was a problem hiding this comment.
I investigated the cross-platform impact. The pointerEvents="none" change is safe across all platforms:
Cross-platform behavior:
- iOS/Android (native): The RN
ViewproppointerEvents="none"prevents the view and all its descendants from being touch targets. Well-documented RN behavior. - Web (React Native Web): Translates to CSS
pointer-events: none— same effect, well-supported in all modern browsers.
Why it's safe for all current usage:
All consumers of the full-screen loader (IOURequestStepScan, IOURequestStepOdometerImage, AttachmentPickerWithMenuItems, and useFilesValidation) use it purely as a visual indicator during transitions where no user interaction with the React Native layer is expected — either a native picker is open above the RN view hierarchy, or background file processing (HEIC conversion) is running.
One latent concern (not currently triggered):
FullScreenLoadingIndicator supports a shouldUseGoBackButton prop that renders a tappable "Go Back" button after a timeout. This prop is not passed in the context provider (defaults to false), so it's not an issue today. If someone were to add it in the future, the button would be unreachable due to pointerEvents="none". But that would require an intentional code change and would be caught in review.
No regressions expected on Android, web, or iOS.
|
I reviewed both changes for cross-platform side effects. Here's a summary: Change 1:
|
| Platform | Change 1 (setTimeout) | Change 2 (pointerEvents) |
|---|---|---|
| iOS Native | ✅ Fix target | ✅ Fix target |
| Android Native | ✅ Safe | |
| Web (Chrome/Safari) | ✅ Not affected | |
| Desktop (Electron) | ✅ Not affected |
Neither concern is a blocker, but the Android delay and the web behavioral change during file processing are worth being aware of.
| delete onModalHide.current; | ||
| }); | ||
| }, 200); | ||
| }, 500); |
There was a problem hiding this comment.
This is magic value and I don't think this is needed anymore. onModalHide.current callback is called on onModalHide, which means modal is fully disappeared.
I have no issue found even after fully removing setTimeout.
There was a problem hiding this comment.
Good call — removed the setTimeout entirely. Since onModalHide.current is invoked via the modal's onModalHide callback, the native view hierarchy should already be fully settled by that point. Pushed in 4b4ae4f.
The onModalHide callback already fires when the modal is fully dismissed, so the setTimeout delay is unnecessary. This addresses review feedback from aimane-chnaif. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
| onClosed.current(); | ||
| delete onModalHide.current; | ||
| }); | ||
| }, 200); |
There was a problem hiding this comment.
@MelvinBot Let's keep original code (200ms timeout) for now, for the safety of regression.
There was a problem hiding this comment.
Restored the original 200ms timeout with its comment. The PR now only contains the pointerEvents="none" fix on FullScreenLoaderContext.tsx — the AttachmentPicker file is unchanged from main. Pushed in 3cb456a.
…eout Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
|
Reverted the |
|
@bernhardoj as a reporter, do you mind testing this branch on your simulator? |
Restores the original setTimeout(200ms) delay in selectItem per reviewer feedback, keeping it for regression safety. The PR now only contains the pointerEvents="none" fix on FullScreenLoaderContext. Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
…sive' into claude-fixIosImagePickerUnresponsive Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
|
The failing check ( Analysis: The failure is in Evidence: The same
This is a known flaky test, not caused by this PR's changes. |
|
@MelvinBot can you check #83997 (comment)? This should help finding the real root cause. |
|
I investigated Root Cause AnalysisThe issue is a view controller hierarchy problem caused by the interaction between ReanimatedModal's dismissal and The chain of events:
Why
|

Explanation of Change
This PR fixes the iOS image picker becoming unresponsive when navigating to Global Create > Create Expenses > Scan > Choose from Gallery.
There are two compounding issues causing this on iOS 18+:
Modal dismiss race condition: The
setTimeout(200ms)delay inAttachmentPicker.selectItem()is insufficient on iOS 18.x. The nativeUIViewControllerhierarchy needs more time to fully settle after theReanimatedModaldismiss beforePHPickerViewControllercan be presented. When presented too early, the picker's touch responder chain is broken. This is increased to 500ms.Touch interception by
FullScreenLoadingIndicator: When the attachment picker opens,onOpenPickersetsisLoaderVisible(true), rendering aFullScreenLoadingIndicatorwithStyleSheet.absoluteFillObjectandzIndex: 10at the app root level. This overlay persists during the entire picker interaction and can intercept touches meant for the native picker. Wrapping it withpointerEvents="none"ensures it remains visible as a loading indicator but does not block touch events.Fixed Issues
$ #83049
PROPOSAL: #83049 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
N/A - Changes are iOS-specific (
.native.tsxfiles). Android behavior unchanged.Android: mWeb Chrome
N/A - Changes are in native-only files.
iOS: Native
This is where the fix applies. Testing required on iOS 18+ device/emulator.
iOS: mWeb Safari
N/A - Changes are in native-only files.
MacOS: Chrome / Safari
N/A - Changes are in native-only files.