Mijick / PopupView

Popups presentation made simple (SwiftUI)
MIT License
1.18k stars 50 forks source link

Stacking on different lanes #98

Closed dentvii closed 2 months ago

dentvii commented 4 months ago

I've encountered an issue when stacking different components on top of each other, such as SwiftUI views. This results in a weird animation glitch.

Steps to Reproduce:

  1. Popup a fullscreen view.
  2. From this fullscreen popup, popup a default bottom sheet view.

The animation behaves unexpectedly as shown in the example below.

Additional Feature Request:

It would be beneficial to have a feature that allows developers to set the priorities of popups, similar to the zIndex used internally. This would enable better control over the popup flow without requiring coordination between parts. For example:

  1. Example 1: The user is on a settings configuration screen (a fullscreen popup) and receives a message (which should appear as a top popup). The message should overlay the view.
  2. Example 2: The user receives a message on top of a fullscreen subscription paywall. The message should NOT be on top of the subscription paywall.

I would appreciate any help in resolving this issue.

Simulator Screen Recording - Traft - iPhone 14 PM 16 4 - 2024-05-18 at 21 53 43

FulcrumOne commented 4 months ago

Hey again, @dentvii!

I like the feature you asked for, will try to do it this week! ;)

Regarding the bug, could you provide me with some additional code, because I have just tested this scenario and in my case it works as expected:

https://github.com/Mijick/PopupView/assets/23524947/c4f76d3f-3a2f-4c6b-954b-a726a00538bb

Thanks again and I look forward to a code sample!

dentvii commented 4 months ago

Thank you for your kindness and the effort you’re putting into this!

I believe the behavior is different from the fullScreen and sheet behavior in Apple's SwiftUI. I will isolate the code and share it here to make the issue reproducible.

FulcrumOne commented 4 months ago

@dentvii, any progress on that?

dentvii commented 4 months ago

I could not isolate the code to share so far, but I reproduced your example using the provided demo, and the issue is connected to glitch regarding edgesFullScreen issue.

image

As soon as I am able to test the branch I will update. Thanks again!

FulcrumOne commented 4 months ago

hey @dentvii,

This feature should be implemented in the branch patch-2.5.0:

CleanShot 2024-06-01 at 02 08 31