Преглед изворни кода

Fallback Plan for LoopStatusView Detent

Mike Plante пре 6 месеци
родитељ
комит
66d0cb0912
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      Trio/Sources/Modules/Home/View/Header/LoopStatusView.swift

+ 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