Skip to content

Commit

Permalink
Fix popovers not showing on Sonoma beta (#477)
Browse files Browse the repository at this point in the history
* Use .rect(bounds) on Sonoma.

* Comment
  • Loading branch information
maxgoedjen authored Jul 23, 2023
1 parent 1d4ef12 commit 5bf5be6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/Secretive/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension ContentView {
.foregroundColor(.white)
})
.buttonStyle(ToolbarButtonStyle(color: color))
.popover(item: $selectedUpdate, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) { update in
.popover(item: $selectedUpdate, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) { update in
UpdateDetailView(update: update)
}
}
Expand Down Expand Up @@ -147,7 +147,7 @@ extension ContentView {
}
})
.buttonStyle(ToolbarButtonStyle(lightColor: .black.opacity(0.05), darkColor: .white.opacity(0.05)))
.popover(isPresented: $showingAgentInfo, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) {
.popover(isPresented: $showingAgentInfo, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) {
VStack {
Text("SecretAgent is Running")
.font(.title)
Expand All @@ -172,7 +172,7 @@ extension ContentView {
.foregroundColor(.white)
})
.buttonStyle(ToolbarButtonStyle(color: .orange))
.popover(isPresented: $showingAppPathNotice, attachmentAnchor: .point(.bottom), arrowEdge: .bottom) {
.popover(isPresented: $showingAppPathNotice, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) {
VStack {
Image(systemName: "exclamationmark.triangle")
.resizable()
Expand All @@ -186,6 +186,11 @@ extension ContentView {
}
}

var attachmentAnchor: PopoverAttachmentAnchor {
// Ideally .point(.bottom), but broken on Sonoma (FB12726503)
.rect(.bounds)
}

}

#if DEBUG
Expand Down

0 comments on commit 5bf5be6

Please sign in to comment.