Skip to content

[BUG]Does not work properly on macOS #178

@ukushu

Description

@ukushu

Prerequisites

  • [ * ] I checked the documentation and found no answer
  • [ * ] I checked to make sure that this issue has not already been filed

Reproduced on
macOS: 15.4.1 (24E263)
xCode: 16.2 (16C5032a)

  • Reproduced on build for macOS
  • Used option 1 from Setup
  • Option 2 works only for iOS so cannot check
  • There are no NavigationStack used in my project

used code:

import MijickPopups

struct Popups {
    static func showHelloWorld() {
        Task {
            await TopCustomPopup()
                .present(popupStackID: .shared)
        }
    }
}


struct TopCustomPopup: TopPopup {
    var body: some View {
        HStack(spacing: 0) {
            Text("Hello World")
            Spacer()
            Button(action: { Task { await dismissLastPopup() }}) { Text("Dismiss") }
        }
        .padding(.vertical, 20)
        .padding(.leading, 24)
        .padding(.trailing, 16)
    }
    
    func configurePopup(config: BottomPopupConfig) -> BottomPopupConfig {
        config
            .popupHorizontalPadding(20)
            .popupTopPadding(42)
            .cornerRadius(16)
    }
    
    func onDismiss() {
        print("Popup dismissed")
    }
    
    func onFocus() {
        print("Popup is now active")
    }
}

applied on MainView:

        .registerPopups(id: .shared) { config in config
           .vertical { $0
               .enableDragGesture(true)
               .tapOutsideToDismissPopup(true)
               .cornerRadius(32)
           }
           .center { $0
               .tapOutsideToDismissPopup(false)
               .backgroundColor(.white)
           }
       }

on subview:

var popupBool = false
        .onTapGesture {
            if popupBool {
                Task { await dismissLastPopup() }
            } else {
                Popups.showHelloWorld()
            }
            
            popupBool.toggle()
        }

Expected behaviour:

  • On click on subview popup appears

Actual behaviour:

  • On click I see dimmed window but with no appeared popup.

Several clicks does not resolve issue.

To see popover view I need to resize window at least once.

Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions