Skip to content
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

Mopups are hidden in background when called after MAUI FilePicker #124

Open
askariya opened this issue Jun 13, 2024 · 3 comments
Open

Mopups are hidden in background when called after MAUI FilePicker #124

askariya opened this issue Jun 13, 2024 · 3 comments

Comments

@askariya
Copy link

askariya commented Jun 13, 2024

Description

All Mopups appear to be hidden in the background when called after a FilePicker.
This means the Mopup can't be closed at all so the app itself becomes impossible to interact with.
To the naked eye it looks like the popup just never appears and the app freezes, but if you step through the creation of a popup you can see the popup briefly appear before it is immediately covered by the original calling page.

I've created a sample app that can reproduce the issue: https://github.com/askariya/MauiPopupsApp
I originally noticed this while trying Prism Popups (that utilizes Mopups) and I have a project where it happens in Prism as well: https://github.com/askariya/MauiPrismMopupsSampleApp

Steps to Reproduce

  1. In a ViewModel, add a call to PickAsync() and follow it with a call to open a Popup Dialog:
  2. var fileData = await FilePicker.PickAsync(); result = await _dialogService.ShowDialogAsync(nameof(PopupNotificationDialog));
  3. Trigger the above call (ex: with a button press).
  4. Select a file or back out such that the File Picker closes.
  5. You will see that the popup does not appear and instead the Page you called from does.
  6. If you repeat this in debug mode with breakpoints for each step you can see that the Popup does appear but is covered by the calling Page immediately.

Video:
https://github.com/LuckyDucko/Mopups/assets/15271126/95ada5ac-e43f-4473-97ee-dd9208b62a8b

  • In the video, you can see the Popup appear very briefly, before the main page covers it again.
  • Note that I am calling the built-in DualResponseViewModel autogenerated popup, but it happens with any of them.
  • At the end of the video, I back out of the hidden popup using the OS back button.
@Sofiya-kumar
Copy link

@askariya I faced the same problem with the file picker. Try to add a delay with 100 ms and check this

@askariya
Copy link
Author

askariya commented Jul 8, 2024

@Sofiya-kumar Thanks for the suggestion; adding a Task.Delay(100) doesn't seem to work either, though.
I think a change will need to be made to the Mopups code to avoid using a workaround like this anyway.

@softlion
Copy link

duplicate of #82

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

No branches or pull requests

3 participants