There is a bug when one uses more that one TextEditors in a same View in VStacks using more that one paragraphs inside de TextEditors. The texts start glitching while writing if the TextEditor are viewing the full TEXT. Example of the code to see the bug. (You need to have MORE that ONE paragraphs in the TextEditors for the BUG to show up. If someone knows how to bypass these bug please let me know. I need to use this in one of my apps and with this bug is not usable.
import SwiftUI
struct ContentView: View {
@State private var sampletext = "Type text #1 using more than one paragraphs"
@State private var sampletext2 = "Type text #2 using more than one paragraphs"
var body: some View {
ScrollView (.vertical) {
VStack {
HStack {
TextEditor(text: $sampletext)
.frame(minWidth: 300, idealWidth: 950, maxWidth: .infinity, minHeight: 100, maxHeight: .infinity, alignment: .topLeading)
.fixedSize(horizontal: false, vertical: true) }
HStack {
TextEditor(text: $sampletext2)
.frame(minWidth: 300, idealWidth: 950, maxWidth: .infinity, minHeight: 100, maxHeight: .infinity, alignment: .topLeading)
.fixedSize(horizontal: false, vertical: true) }
}.padding()
}
}
}