Fix compose main text view sizing on iOS 15
This commit is contained in:
parent
bfee9ea124
commit
8d6c63d5e9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user