Fix the FilePicker.PickMultipleAsync() Not Returning Null When Canceled#27961
Merged
rmarinho merged 1 commit intodotnet:net10.0from Mar 21, 2025
Merged
Fix the FilePicker.PickMultipleAsync() Not Returning Null When Canceled#27961rmarinho merged 1 commit intodotnet:net10.0from
rmarinho merged 1 commit intodotnet:net10.0from
Conversation
4 tasks
Contributor
There was a problem hiding this comment.
Copilot reviewed 3 out of 10 changed files in this pull request and generated 3 comments.
Files not reviewed (7)
- src/Essentials/src/PublicAPI/net-android/PublicAPI.Shipped.txt: Language not supported
- src/Essentials/src/PublicAPI/net-ios/PublicAPI.Shipped.txt: Language not supported
- src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt: Language not supported
- src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Shipped.txt: Language not supported
- src/Essentials/src/PublicAPI/net-windows/PublicAPI.Shipped.txt: Language not supported
- src/Essentials/src/PublicAPI/net/PublicAPI.Shipped.txt: Language not supported
- src/Essentials/src/PublicAPI/netstandard/PublicAPI.Shipped.txt: Language not supported
Comments suppressed due to low confidence (1)
src/Essentials/src/FilePicker/FilePicker.uwp.cs:43
- Ensure that there is a test case that covers the scenario where resultList.Count == 0 and the method returns null.
return resultList.Count == 0 ? null : resultList.Select(storageFile => new FileResult(storageFile));
1a4ac3e to
517f10d
Compare
517f10d to
36dfc3e
Compare
jsuarezruiz
approved these changes
Mar 11, 2025
36dfc3e to
e0eea1c
Compare
Member
|
/rebase |
e0eea1c to
02e847d
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
approved these changes
Mar 20, 2025
Contributor
|
🚨 API change(s) detected @davidbritch FYI |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Issue Details
If the user cancels the file picking, the result must be null. However, FilePicker.PickMultipleAsync() does not return a null value.
Root Cause
The method currently returns a file result value even when the user cancels the file pick operation.
Description of Change
Modify the FilePicker.PickMultipleAsync() method to be nullable and return null when the user cancels the file pick operation.
Validated the behavior in the following platforms
Issues Fixed
Fixes #27710
Output ScreenShot
BeforeFix.mov
AfterFix.1.mov