In a SwiftUI app on iPhone when the device is put to sleep by pressing the power button, while the app is presenting a .sheet, waking the device will result in the touch layout to not match the UI layout. See attached project to reproduce the issue. This happens with Xcode 14.2, targeting iOS 16.0.
Steps to reproduce (assuming the app has been built an running on a real device, xcode project linked at the bottom):
- Tap the “Hello World” button. This opens a plain sheet with a fully green color content
- Push the device’s power button to put it to sleep
- Push the device’s power button again to wake the device
- Optionally unlock the device if needed
- Dismiss the opened green sheet (the app should still be open and displaying the sheet after waking the device)
- Try to tap the “Hello World” button again.
Observed behavior:
- the area required to tap to activate the button no longer matches the UI and you have to tap below the button to activate it.
Desired behavior:
- after waking the device and dismissing the sheet, the touch and ui layout should still be correct.