onDismiss of sheet() is never getting called

I am using the .sheet() modifier which takes the onDismiss parameter, on macOS. Looks like the onDismiss is never getting invoked, either with the ESC key or with by explicitly setting to false in the isPresented binding.

Code Block
.background(EmptyView()
.sheet(
isPresented: self.$store.presented,
onDismiss: { print("dismissed")}, /* never gets called*/
content: {
ConfigureRecordingView()
.environmentObject(self.theme)
.environmentObject(self.store)
})
)


How do I fix this? I have run out of ideas :-|
I got into the same situation today. When you try to call the sample code from the Apple documentation, you will find that "dismiss" is called on iOS but nothing on macOS.
https://developer.apple.com/documentation/swiftui/view/sheet(ispresented:ondismiss:content:)
onDismiss of sheet() is never getting called
 
 
Q