-
-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Bug Description
When using PopupSceneDelegate to register popups, the popup UIWindow intercepts all user touches on the screen even when the popup has .overlayColor(.clear) and .tapOutsideToDismissPopup(false) configured. This makes it impossible to create non-blocking toast/banner notifications using TopPopup.
The same popups work correctly with registerPopups() (SwiftUI overlay approach).
Steps to Reproduce
- Set up the framework with PopupSceneDelegate
- Create a TopPopup with .heightMode(.auto), .overlayColor(.clear), .tapOutsideToDismissPopup(false)
- Present the popup
- Try tapping or scrolling the app content behind the popup - touches are blocked
Root Cause
Two issues in the Window class (Public+Setup+SceneDelegate.swift):
1. Overlay always hit-testable
In PopupView.swift, createOverlayView() always attaches .onTapGesture(perform: onTap) to the overlay Color. Even when the color is .clear, this makes the backing UIKit view hit-testable, so the popup window claims the touch.
2. Container views found by hitTest
SwiftUI layout containers (GeometryReader, ZStack, popup stack views) create full-screen UIKit backing views. The Window.hitTest methods (iOS 17/18/26) find these container views and return them, causing the window to capture touches that should pass through to the main app window.
Proposed Fix
See PR #206
Environment
- MijickPopups 4.0.5
- iOS 18.x
- Using PopupSceneDelegate setup