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

SwiftUI masked items zindex on top of everything #295

Open
sterien7 opened this issue Feb 10, 2025 · 8 comments
Open

SwiftUI masked items zindex on top of everything #295

sterien7 opened this issue Feb 10, 2025 · 8 comments
Labels
bug Something isn't working Session Replay

Comments

@sterien7
Copy link

Version

3.19.4

Steps to Reproduce

  1. mask an image or a text in one screen
  2. press a button that opens a fullscreen or a bottomSheet screen
  3. on the session replay the black boxes that created on the first screen are visible on the second and blocks useful part of screen

Expected Result

The second screen that opens on top of the first must have a bigger zindex than the masked boxes

Actual Result

The black boxes that are inserted to the screen capture looks like they have a very big z-index so they are visible on every screen that is on top of the screen that has the actual masked elements (Images and texts)

Screen.Recording.2025-02-10.at.16.03.19.mov
@sterien7 sterien7 added the bug Something isn't working label Feb 10, 2025
@ioannisj
Copy link
Contributor

Hey @sterien7, thanx for reporting this. The way this is currently implemented is

  • we take a screenshot of the screen
  • we draw on top of that screenshot the black rects that will mask the data

I imagine the problem is that the maskable views are in the view hierarchy and somehow we fail to detect that they are not visible, so we can safely ignore them. Can you share a small snippet of how you present the fullscreen view in the screen recording you attached?

@sterien7
Copy link
Author

Sure @ioannisj
This is how the main screen looks like.
At the bottom there is the .fullScreenCover modifier

var body: some View {
    
    VStack(spacing: 0) {
        // Here are all the views of the Home Screen
    }
    // Here go all modifiers an the .fullScreenCover
    .fullScreenCover(item: $fullScreenCover) { fullScreenCover in
        switch fullScreenCover {
        case .shortcuts:
            ShortcutActionsView(safeAreaInsets: .init())
                .postHogScreenView(.shortcuts, fromScreen: .home(.root))
                .presentationBackground(.ultraThinMaterial)
                .interactiveDismissDisabled()
                .navigationTransition(.zoom(sourceID: FullScreen.shortcuts, in: namespace))
                .id(FullScreen.shortcuts)
        case .....: // other cases
        }
    }
}

Ευχαριστω!

@ioannisj
Copy link
Contributor

Hey @sterien7 thanx for the patience here! I just pushed a quick/messy fix to fix/full-or-partial-cover-masking.

Could you point your dependency to that branch and let me know if this resolves the issue on your end? Just wanted to check with you before cleaning this up. Appreciate it!

@marandaneto
Copy link
Member

ping @sterien7

@sterien7
Copy link
Author

Sorry guys I was out I will check it first thing next week

@sterien7
Copy link
Author

@ioannisj @marandaneto it doesn't work for my case

@ioannisj
Copy link
Contributor

@sterien7 Thanx for taking the time to check. I'll have another look and come back to you!

@marandaneto
Copy link
Member

@sterien7 Thanx for taking the time to check. I'll have another look and come back to you!

did you manage to reproduce this? @ioannisj or should we ask for an MRE?

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

No branches or pull requests

3 participants