[Bug] Sheet detent is not maintained after back to foreground
Describe the bug
Sheet detent is not maintained after back to foreground, e.g when we set detent to medium and present it, it work for just normal until we home app to background and reenter app, when app is back to foreground the sheet detents seems to be reset to large.
To Reproduce
Steps to reproduce the behavior (Example app):
0. Set the sheet detent to [.medium]
- Open app
- Click on
Open sheet - Home app
- Reopen app
Expected behavior
After reopen app the sheet detent should maintains as before medium.
Screenshots https://github.com/user-attachments/assets/26ae9515-0314-497a-805c-fbfbb15fce89
Smartphone (please complete the following information):
- Device: iPhone 14 Plus
- OS: iOS 16.1
- Browser [e.g. stock browser, safari]
- Version: 1.2.5
Feel free to give a shot fixing it. That said -- this whole API is part of SwiftUI now (and better in some ways), so I would consider this "unmaintained".
Thank you for prompt reply, I came up with a workaround by listening the UIApplication.willEnterForegroundNotification event to reset the configuration the inside HostingController's lifecycle, this should work.
if you have a well tested PR feel free to put it up