I have a very simple TextEditor in a SwiftUI Form to allow users to send feedback about the app.
I want to set a minHeight and maxHeight for the text field so that it's clear the user can enter multiple lines. However, I also want to prevent the editor from expanding indefinitely and making it hard to access other form fields or the submit button.
*Problem: The issue I'm facing is that after typing for a while (or reaching a certain input length), the UI starts behaving unexpectedly — it starts adding phantom whitespace (or padding) to the bottom of the field. This happens when testing in Preview, the Simulator, and on a real device.
Here’s the code for the TextEditor:
TextEditor(text: $description)
.frame(minHeight: 200, maxHeight: 400)
.disabled(processState.isRunning)
.fixedSize(horizontal: false, vertical: true)
.onChange(of: description) { _, newValue in
if newValue.count > characterLimit {
description = String(newValue.prefix(characterLimit))
}
}
What I've tried:
- Removing the
.onChangelogic to rule it out, but the issue persists. - Tested across different platforms (Preview, Simulator, device), but I see the same behavior.
Has anyone encountered a similar issue with TextEditor in SwiftUI or have suggestions on how to fix or troubleshoot this?

TextField("Feedback", text: $feedback, axis: .vertical).lineLimit(2...)