Skip to content

[iOS] Fix: FilePicker.PickAsync hangs on swipe-to-dismiss in older iOS versions #30289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bhavanesh2001
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Follow up to (#29498)

This PR ensures FilePicker.PickAsync completes correctly when the user dismisses the file picker by swiping down on iOS older versions , where WasCancelled is not reliably triggered. ( I can reproduce this on iOS15.5).

Somehow in older iOS versions dismissing the UIDocumentPickerViewController via swipe-down gesture does not invoke the WasCancelled event. As a result, the TaskCompletionSource is never completed, causing PickAsync to hang.

Fix

UIPresentationController.Delegate was already used in the legacy delegate-based file picker path.
This PR extends that logic to also apply to the modern event-based picker API (DidPickDocumentAtUrls, WasCancelled), ensuring consistent cancellation handling across all code paths.

Issues Fixed

Fixes #30282

@bhavanesh2001 bhavanesh2001 requested a review from a team as a code owner June 27, 2025 20:30
Copy link
Contributor

Hey there @@bhavanesh2001! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FilePicker.PickAsync Task Hangs When User Swipes Down to Cancel the Picker
1 participant