QuickLook sheet not opening in iOS

I'm developing an application in which saving files and opening them with .quickLookis in important role.

However, after putting my application to TestFlight and letting a friend of mine test it with his phone (iOS 17.4.1, iPhone 15 Pro) it appears that sometimes when opening a file the QuickLook sheet doesn't open until the app's focus is lost.

@State 
Button("Open file") {
    url = someFileUrl
}.quickLookPreview($url)

fix:

@State
...

to

@State private var url: URL? = nil
QuickLook sheet not opening in iOS
 
 
Q