SwiftUI Safe Area Inset Animation Curve Doesn't Match Keyboard Animation Curve
Originator: | bryn.bodayle | ||
Number: | rdar://FB16647719 | Date Originated: | 2/27/25 |
Status: | Open | Resolved: | |
Product: | SwiftUI | Product Version: | iOS 18.3.1 |
Classification: | Bug | Reproducible: | Always |
There are two issues demonstrated in the below sample code and attached video running on device. https://www.dropbox.com/scl/fi/bye0fo3apjr7id34te4cz/SwiftUI-Safe-Area-Inset-Bug.MP4?rlkey=kkvehqy9r169fxgz0ll07w8o7&st=listqb91&dl=0 1. On the first time opening the keyboard during an app session, the safe area inset is adjusted after the keyboard is opened, causing the red bordered view to go under the keyboard instead of remaining on top of it. 2. On subsequent opens and dismisses of the keyboard you'll notice that the animation curves/timing between the keyboard and safe area inset adjustment are slightly different causing the view above the safe area inset to not animate alongside the keyboard. struct ContentView: View { var body: some View { ScrollView { LazyVStack { TextField("test", text: .constant("")) } } .scrollDismissesKeyboard(.interactively) .safeAreaInset(edge: .bottom) { Rectangle() .background(.gray) .frame(height: 44) .border(.red) } } }
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at feedbackassistant.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!