Post

Replies

Boosts

Views

Activity

iOS 16 TextField, axis parameter, and keyboard avoidance
I've not seen the issue I'm having discussed here since iOS 16 dropped. I've added the axis: .vertical parameter to a TextField view to make it expand vertically, eliminating the need for a ZStack hack that accomplished the same previously. The automatic keyboard avoidance behavior that was working as-expected prior to adding the new parameter has ceased. When I tap in the TextField now, the keyboard jumps up and covers it. It again works correctly if I remove the axis parameter. Has anyone else seen this? Here's the code snippet in question: TextField("", text: $cocktail.userNotes, axis: .vertical)    .placeHolder(Text("My notes"), show: cocktail.userNotes.isEmpty)    .autocapitalization(.sentences)\    .textFieldStyle(CustomTextFieldStyle())    .background(Color(profile.appData.colorTheme.editableTextFieldColor))    .frame(width: UIDevice.current.userInterfaceIdiom == .pad ? 240 : 280)
1
3
1.4k
Jan ’23
iOS 16 TextField, axis parameter, and keyboard avoidance
I've not seen the issue I'm having discussed here since iOS 16 dropped. I've added the axis: .vertical parameter to a TextField view to make it expand vertically, eliminating the need for a ZStack hack that accomplished the same previously. The automatic keyboard avoidance behavior that was working as-expected prior to adding the new parameter has ceased. When I tap in the TextField now, the keyboard jumps up and covers it. It again works correctly if I remove the axis parameter. Has anyone else seen this? Here's the code snippet in question: TextField("", text: $cocktail.userNotes, axis: .vertical)    .placeHolder(Text("My notes"), show: cocktail.userNotes.isEmpty)    .autocapitalization(.sentences)\    .textFieldStyle(CustomTextFieldStyle())    .background(Color(profile.appData.colorTheme.editableTextFieldColor))    .frame(width: UIDevice.current.userInterfaceIdiom == .pad ? 240 : 280)
Replies
1
Boosts
3
Views
1.4k
Activity
Jan ’23