Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[Bug] iOS: Swipe down to close MediaPicker.PickPhotoAsync navigates back to initial viewcontroller #1757

Closed
MikaelStalvik opened this issue Apr 14, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@MikaelStalvik
Copy link

Description

If you swipe down the MediaPicker.PickPhotoAsync on iOS to cancel the modal dialog, the ViewController is dismissed and the user is navigated back to the applications root page.

Steps to Reproduce

  1. Open the PickPhoto modal dialog on iOS
  2. Swipe down to cancel

Expected Behavior

The modal shall close just in the same way as if Cancel were pressed and the application shall be able to handle the result.

Actual Behavior

The modal is closed and the user is navigated back to the root page.
Swipe down to close the modal dialog shall work in the same was as if you are pressing Cancel and trigger the same code.

Basic Information

  • Version with issue: 1.6.1
  • Last known good version: -
  • IDE: VS2019
  • Platform Target Frameworks:
    • iOS: 13.x+
  • Affected Devices: iOS devices
@MikaelStalvik MikaelStalvik added the bug Something isn't working label Apr 14, 2021
@rhult
Copy link

rhult commented Apr 14, 2021

Could be good to add that it's probably the following line that it causing the issue:

await vc.DismissViewControllerAsync(true);

When the user swipes down, the modal is already dismissed, so the parent view controller will be dismissed.

@dimonovdd
Copy link
Contributor

I do not think that this is a bug, the method works correctly and returns null.

2021-04-14.20.51.21.mov

@rhult
Copy link

rhult commented Apr 15, 2021

@dimonovdd IIUC, if you present the picker from a modal vc, the line above will dismiss the modal vc. First the user swipes down the picker, which implicitly dismisses the picker. The dismiss call pointed out above will then dismiss the current modal vc, which is not the picker but the modal vc that presented the picker. This leads to the dismissal of a vc that is not owned by the picker code but by the caller. I think if there is no modal vc, the dismiss call will have no effect which is why the video above looks right.

@dimonovdd
Copy link
Contributor

@rhult @MikaelStalvik Can you send a sample?

@MikaelStalvik
Copy link
Author

@dimonovdd Here's a sample:
https://www.dropbox.com/s/2avuqc5sq3uja5d/EssentialsNav.zip?dl=0

To reproduce the issue, perform these steps:

  1. Start app. A blue screen is shown for two seconds, then a red screen appears
  2. From the red screen, click "Pick photo"
  3. Click the Cancel button => the modal dialog disappears and the red screen remains
  4. Click "Pick photo"
  5. Swipe-down to hide the modal dialog

Actual result:
You can see that the blue screen is showed for a while and after that the red screeen opens again.

Expected result:
Closing the modal dialog with swipe-down shall behave in the same way as in step 3 above.

@dimonovdd
Copy link
Contributor

I'll watch it this weekend

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants