Fix compose main text view sizing on iOS 15

This commit is contained in:
Shadowfacts 2025-02-23 00:28:28 -05:00
parent bfee9ea124
commit 8d6c63d5e9

View File

@ -19,6 +19,7 @@ struct NewMainTextView: View {
var body: some View {
NewMainTextViewRepresentable(value: $value, becomeFirstResponder: $becomeFirstResponder, handleAttachmentDrop: handleAttachmentDrop)
.frame(minHeight: Self.minHeight)
.focused($focusedField, equals: .body)
.modifier(FocusedInputModifier())
.overlay(alignment: .topLeading) {
@ -58,6 +59,10 @@ private struct NewMainTextViewRepresentable: UIViewRepresentable {
.font: UIFontMetrics.default.scaledFont(for: .systemFont(ofSize: 20)),
]
view.backgroundColor = nil
// on iOS 15, this is needed to prevent the text view from growing horizontally
if #unavailable(iOS 16.0) {
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
}
// view.layer.cornerRadius = 5
// view.layer.cornerCurve = .continuous