From 44d5410eefbc32021f74bbec8d7c5d0daff25e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthieu=20D=C3=A9glon?= Date: Mon, 28 Oct 2024 08:52:25 +0100 Subject: [PATCH] refactor: Add early guard --- .../InfomaniakCoreSwiftUI/Modifiers/FloatingPanelHelper.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/InfomaniakCoreSwiftUI/Modifiers/FloatingPanelHelper.swift b/Sources/InfomaniakCoreSwiftUI/Modifiers/FloatingPanelHelper.swift index 3bb0031..89cfb8d 100644 --- a/Sources/InfomaniakCoreSwiftUI/Modifiers/FloatingPanelHelper.swift +++ b/Sources/InfomaniakCoreSwiftUI/Modifiers/FloatingPanelHelper.swift @@ -206,6 +206,7 @@ public struct SelfSizingPanelViewModifier: ViewModifier { .padding(.bottom, value: .medium) } .introspect(.scrollView, on: .iOS(.v16, .v17, .v18)) { scrollView in + guard selection != .height(headerSize) else { return } let totalPanelContentHeight = scrollView.contentSize.height + headerSize guard selection != .height(totalPanelContentHeight) else { return }