Skip to content

Commit

Permalink
🐞 Fix: Make LuminareColorPicker close when modal window is defocused
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Sep 12, 2024
1 parent 18b70da commit 4de2df1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Luminare/Modal Window/LuminareModalWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class LuminareModal<Content>: NSWindow, ObservableObject where Content: View {
override var canBecomeMain: Bool {
true
}

override func resignMain() {
if closeOnDefocus {
close()
}
}
}

struct LuminareModalModifier<PanelContent>: ViewModifier where PanelContent: View {
Expand Down

0 comments on commit 4de2df1

Please sign in to comment.