Search code examples
iosswiftswiftuiscrollviewtextfield

On selecting TextField (opening keyboard) in ScrollView - content jumps down and back with keyboard


My TextField inside of ScrollView, when I select it, all content jumps firstly down, and returns back with keyboard.

ScrollView {
  VStack {
     TextField("Placeholder", $value)
     Button()
       .keyboardResponsive(enabled: true)
  }
}

Solution

  • The reason was in property keyboardResponsiveEnabled of one of used on screen button. Parent class of it has keyboardResponsiveEnabled = true by default. So if you have such problem, check all elements on screen with superclasses for this property.