NilCoalescing / SwiftUI-Code-Examples

In this repository we are collecting our solutions to interesting SwiftUI problems that we encounter when developing our apps.
MIT License
253 stars 40 forks source link

Adding .scrollDismissesKeyboard(.interactively) results in weird TextField behavior #6

Open iband opened 1 year ago

iband commented 1 year ago

When you attach TextField to keyboard like that: https://github.com/NilCoalescing/SwiftUI-Code-Examples/blob/23acc112d124508690fa8c5edfad53f87a20bde7/PinAViewToTheBottomOfSafeArea/PinAViewToTheBottomOfSafeArea.swift#L17 TextField is not interactively dismissed with keyboard (example of the issue on stack overflow: https://stackoverflow.com/questions/73770425/scrollview-scrolldismisseskeyboard-interactively-feels-weird).

Is there a way to achieve behavior like in iMessage with SwiftUI?

iband commented 1 year ago

I wonder if there are any changes to this in iOS 17? I looks like we have a few new customizations for UIKit, but not SwiftUI 🤔