iOS MediaPicker.CapturePhotoAsync closes the wrong modal #27513
Labels
area-essentials
Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info
platform/iOS 🍎
t/bug
Something isn't working
Description
After
MediaPicker.CapturePhotoAsync()
returns theFileResult
, the Camera modal is still on screen. If subsequent code tries to open a modal like:the new modal won't display or is closed with the Camera modal?
I think the task from
.CapturePhotoAsync()
is returning before the Camera modal close() + close animations are complete, and so it is also closing the new modal just added to stack?Steps to Reproduce
Build/run the app for iOS (I am currently using Rider). In app, click the "test" link btn on bottom right, then click "From Camera" btn.
Link to public reproduction project repository
https://xdevapps.visualstudio.com/DefaultCollection/XDev.Maui.ManualCrop/_git/XDev.Maui.ManualCrop
Version with bug
8.0.100 SR10
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
iOS
Affected platform versions
iOS 17.5, 17.2
Did you find any workaround?
yes.
this code is the work around, by dispatching the call to
Application.Current?.MainPage?.Navigation.PushModalAsync()
I think it allows the new modal navigation run afterMediaPicker.CapturePhotoAsync()
completes the camera display UI close animation, and everything works as expected.Relevant log output
The text was updated successfully, but these errors were encountered: