From d2bfcf81d24f86a60a6f7e4ba89e47f53c27d563 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 27 Jun 2025 10:51:05 +0300 Subject: [PATCH] Attempt to fix message composer layout crashes when running as an iPad app on MacOS --- .../ComposerToolbar/View/MessageComposerTextField.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift index 208c5f04f..26b5419bd 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift @@ -96,8 +96,7 @@ private struct UITextViewWrapper: UIViewRepresentable { func sizeThatFits(_ proposal: ProposedViewSize, uiView: UITextView, context: Context) -> CGSize? { // Note: Coalescing a width of zero here returns a size for the view with 1 line of text visible. - let newSize = uiView.sizeThatFits(CGSize(width: proposal.width ?? .zero, - height: CGFloat.greatestFiniteMagnitude)) + let newSize = uiView.sizeThatFits(CGSize(width: proposal.width ?? .zero, height: maxHeight)) let width = proposal.width ?? newSize.width let height = min(maxHeight, newSize.height)