Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScrollView .scrollDismissesKeyboard(.interactively) feels weird

I set up a ScrollView like so:

ScrollView(.vertical) {
    // ...
}
.scrollDismissesKeyboard(.interactively)
.safeAreaInset(edge: .bottom, spacing: 0) {
    TextInputCellView(with: Color(hex: 0xf5f9fc)) { value in
        vm.send(text: value)
    }
}

The newly added scrollDissmissesKeyboard works, does however look and feel a little weird. Is this a bug or am i doing anything wrong ?

enter image description here

like image 471
Lukas Avatar asked May 02 '26 18:05

Lukas


1 Answers

This is a SwiftUI bug: https://github.com/feedback-assistant/reports/issues/437

Please try my solution https://github.com/frogcjn/BottomInputBarSwiftUI

  1. docks the bottom side
  2. changes the keyboardDismissPadding
  3. updates the safe area inset correctly

This solution uses keyboard layout guide to track the keyboard location, and add a BottomBar SwiftUI View to the layout guide.

It also changes keyboardDismissPadding accurately for interactively dismissing the keyboard.

like image 150
frogcjn Avatar answered May 05 '26 07:05

frogcjn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!