Thursday, February 29, 2024
HomeiOS Developmentios - Unusual Habits with SwiftUI TextEditor after Copy-Pasting Content material

ios – Unusual Habits with SwiftUI TextEditor after Copy-Pasting Content material


I am dealing with a problem with a TextEditor element in my SwiftUI view. At any time when I copy-paste content material into the TextEditor, it begins to flicker whereas typing, and parts of the textual content content material develop into hidden. It seems that there could be an issue with accurately figuring out the content material measurement. Has anybody else encountered an identical challenge or discovered a workaround for it? Any insights or recommendations can be enormously appreciated.

This is a simplified model of my code:

struct ContentView: View {
    @State var notes = ""
    var physique: some View {
        VStack {
            TextEditor(textual content: $notes)
                .foregroundStyle(Shade.black)
                .body(top: 142)
                .overlay(
                    RoundedRectangle(cornerRadius: 8)
                        .stroke(Shade.grey, lineWidth: 1)
                )
            Spacer()
        }
        .padding()
    }
}

enter image description here



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments