File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Modules/Sources/WooFoundation/ViewModifiers
WooCommerce/Classes/Bookings/BookingList Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ public extension View {
1111 return self
1212 }
1313
14+ /// Applies modifiers within a closure.
15+ /// Helpful for setting different modifiers conditionally (e.g. OS versions).
16+ ///
17+ func apply< V: View > ( @ViewBuilder _ block: ( Self ) -> V ) -> V {
18+ block ( self )
19+ }
20+
1421 /// Applies the given transform if the given condition evaluates to `true`.
1522 /// - Parameters:
1623 /// - condition: The condition to evaluate.
Original file line number Diff line number Diff line change @@ -120,9 +120,21 @@ private extension BookingListView {
120120 } header: {
121121 header
122122 . listRowInsets ( EdgeInsets ( ) )
123+ . textCase ( nil )
123124 }
124125 }
125- . listStyle ( . plain)
126+ . apply {
127+ /// Plain list style in iOS prior to 26.0 comes with extra spacing at the top of header.
128+ /// Use grouped style for these versions instead.
129+ /// Grouped list style doesn't pin header at the top, we have to accept this.
130+ if #available( iOS 26 . 0 , * ) {
131+ $0. listStyle ( . plain)
132+ } else {
133+ $0. listStyle ( . grouped)
134+ }
135+ }
136+ . listStyle ( . grouped)
137+ . scrollContentBackground ( . hidden)
126138 . listSectionSeparator ( . hidden, edges: . top)
127139 . background ( Color ( . listBackground) )
128140 . refreshable {
You can’t perform that action at this time.
0 commit comments