diff --git a/Sources/QGrid/QGrid.swift b/Sources/QGrid/QGrid.swift index a81f2c9..457a6e9 100644 --- a/Sources/QGrid/QGrid.swift +++ b/Sources/QGrid/QGrid.swift @@ -103,13 +103,15 @@ public struct QGrid: View public var body : some View { GeometryReader { geometry in Group { - if self.isScrollable { - ScrollView(showsIndicators: self.showScrollIndicators) { - self.content(using: geometry) + if !self.data.isEmpty { + if self.isScrollable { + ScrollView(showsIndicators: self.showScrollIndicators) { + self.content(using: geometry) + } + } else { + self.content(using: geometry) + } } - } else { - self.content(using: geometry) - } } .padding(.horizontal, self.hPadding) .padding(.vertical, self.vPadding)