Skip to content

Commit 2d97d73

Browse files
committed
using preferences from final result instead of dryRunResult
1 parent 0447fa0 commit 2d97d73

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Sources/SwiftCrossUI/Views/Modifiers/SheetModifier.swift

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,7 @@ struct SheetModifier<Content: View, SheetContent: View>: TypeSafeView {
8282
})
8383
let sheetEnvironment = environment.with(\.dismiss, dismissAction)
8484

85-
let dryRunResult = children.sheetContentNode!.update(
86-
with: sheetContent(),
87-
proposedSize: backend.sizeOf(sheet),
88-
environment: sheetEnvironment,
89-
dryRun: true
90-
)
91-
92-
let preferences = dryRunResult.preferences
93-
94-
let _ = children.sheetContentNode!.update(
85+
let result = children.sheetContentNode!.update(
9586
with: sheetContent(),
9687
proposedSize: backend.sizeOf(sheet),
9788
environment: sheetEnvironment,
@@ -103,6 +94,8 @@ struct SheetModifier<Content: View, SheetContent: View>: TypeSafeView {
10394
onDismiss: { handleDismiss(children: children) }
10495
)
10596

97+
let preferences = result.preferences
98+
10699
// MARK: Sheet Presentation Preferences
107100
if let cornerRadius = preferences.presentationCornerRadius {
108101
backend.setPresentationCornerRadius(of: sheet, to: cornerRadius)

0 commit comments

Comments
 (0)