Skip to content

[BUG] PopupSceneDelegate window blocks all touches when tapOutsideToDismissPopup is false #207

@yaro-zakh

Description

@yaro-zakh

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

  1. Set up the framework with PopupSceneDelegate
  2. Create a TopPopup with .heightMode(.auto), .overlayColor(.clear), .tapOutsideToDismissPopup(false)
  3. Present the popup
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions