Skip to content

Commit fa88454

Browse files
Merge pull request #79 from componentskit/fix-sumodal-layout
Force modal's content take all available width
2 parents c55bc44 + 86f6420 commit fa88454

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Diff for: Examples/DemosApp/DemosApp/ComponentsPreview/Helpers/ModalPreview+Helpers.swift

+12-8
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,20 @@ Enim habitant laoreet inceptos scelerisque senectus, tellus molestie ut. Eros ri
203203
}
204204

205205
static func suBody(body: ContentBody) -> some View {
206-
Group {
207-
switch body {
208-
case .shortText:
209-
Text(self.bodyShortText)
210-
case .longText:
211-
Text(self.bodyLongText)
206+
HStack {
207+
Group {
208+
switch body {
209+
case .shortText:
210+
Text(self.bodyShortText)
211+
case .longText:
212+
Text(self.bodyLongText)
213+
}
212214
}
215+
.font(self.bodyFont.font)
216+
.multilineTextAlignment(.leading)
217+
218+
Spacer()
213219
}
214-
.font(self.bodyFont.font)
215-
.multilineTextAlignment(.leading)
216220
}
217221

218222
static func suFooter(

Diff for: Sources/ComponentsKit/Components/Modal/SwiftUI/ModalContent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct ModalContent<VM: ModalVM, Header: View, Body: View, Footer: View>: View {
4343
.padding(.top, self.bodyTopPadding)
4444
.padding(.bottom, self.bodyBottomPadding)
4545
}
46-
.frame(maxHeight: self.scrollViewMaxHeight)
46+
.frame(maxWidth: .infinity, maxHeight: self.scrollViewMaxHeight)
4747
.disableScrollWhenContentFits()
4848

4949
self.contentFooter()

0 commit comments

Comments
 (0)