Repository navigation
Conversation
presentationControllerWillDismiss finished the request right away, but UIKit calls it as soon as the user starts pulling the sheet down, even if they let it spring back. The pick completed as cancelled while the picker stayed open, and the files selected afterwards were dropped because the request had already been cleared. Wait for the dismissal transition to end and only finish the request if it was not cancelled. A completed dismissal, including the fast swipe from #2021 that may never reach presentationControllerDidDismiss, still finishes the request. Without a transition coordinator it finishes right away, as before. Bumps file_picker_darwin to 2.1.4. Fixes #2243
1 of 4 tasks
navaronbracke
approved these changes
Oct 10, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2243
Problem
On iOS, starting to swipe the picker sheet down and letting it spring back completed
pickFiles()with an empty list while the picker stayed open. The files selected afterwards were dropped.presentationControllerWillDismissfinished the request right away, but UIKit calls it as soon as the user starts pulling the sheet down, even if the dismissal is then cancelled.finishCurrentRequest(nil)clearedresult, so the laterpicker(_:didFinishPicking:)hit itsguard let currentResult = resultand returned early. Thanks to @chrisbobbe for the precise diagnosis.presentationControllerWillDismisswas added in #2040 to fix #2021, where a very fast swipe could leave the picker stuck and fail every later pick withmultiple_request, so it cannot simply be removed.Change
presentationControllerWillDismissnow waits for the dismissal transition to end through the presented view controller'stransitionCoordinator, and only finishes the request if the transition was not cancelled.presentationControllerDidDismisskeeps finishing it as well, which is harmless sincefinishCurrentRequestignores a request that is already finished.Bumps
file_picker_darwinto 2.1.4.Testing