Sfoglia il codice sorgente

Fallback Plan for LoopStatusView Detent

Mike Plante 6 mesi fa
parent
commit
66d0cb0912

+ 5 - 1
Trio/Sources/Modules/Home/View/Header/LoopStatusView.swift

@@ -129,7 +129,11 @@ struct LoopStatusView: View {
         .onAppear {
             lastDetermination = state.determinationsFromPersistence.first
         }
-        .presentationDetents([.height(sheetContentHeight)])
+        .presentationDetents([
+            sheetContentHeight > 0
+                ? .height(sheetContentHeight)
+                : .fraction(0.9)
+        ])
         .presentationDragIndicator(.visible)
         .onPreferenceChange(ContentSizeKey.self) { newSize in
             sheetContentHeight = newSize.height