TexEditors: Bug when using more than one TextEditors in a same View in VStacks (Texts glitching)

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()
}
}
}

You need to be more specific. You need to describe you test environment: Xcode version, operating system and its version (Since SwiftUI is cross-platform it could be about macOS or iOS, etc). Also you need to be more specific about the type of glitch you observe. If it is hard to describe, you can include a screenshot that shows the glitch.

Two more things:

MacOS 11.2 RC2 (20D62)
Xcode 12.4 RC (12D4e)
And older

Running in iOS14.4 /iPadOS and older and MacOS 11.0-11.2RC2

Glitches: All texts jumps while writing.

You should report bugs in Apple frameworks at https://feedbackassistant.apple.com/ so Apple can fix them.

As for getting help for your problem, I'd suggest either Stack Overflow or Apple's developer forum.

Done it. But no fix yet.

Terms of Service

Privacy Policy

Cookie Policy