10

When I enter (or paste) text in a TextField on macOS and the string requires more space than available in TextField I would expect some sort of scrolling behaviour that moves along with the text cursor - like in almost every text field in the world. Instead I only see the beginning of the text and can't see my new input anymore. I cannot even scroll manually. Only if I enlarge the TextField and then shrink it again, I am able to scroll through it. See video:

macos text field

Is this a SwiftUI bug? Any known solutions for this?

Here's the code:

struct ContentView: View {
    @State private var text: String = ""
    var body: some View {
        TextField("", text: $text)
            .padding()
    }
}
viedev
  • 869
  • 1
  • 6
  • 16

1 Answers1

0

Yes, this seems to be a bug. I could reproduce it in 12.0 and 12.5 but Ventura beta release behaves much better.

user2555515
  • 779
  • 6
  • 20