Skip to content

Commit f7ba545

Browse files
committed
Hide redundant list row separators
1 parent fa1d104 commit f7ba545

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

WooCommerce/Classes/Bookings/BookingFilters/SyncableListSelectorView.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ private extension SyncableListSelectorView {
7777
}
7878
)
7979
.renderedIf(viewModel.searchQuery.isEmpty)
80+
.listRowSeparator(.hidden, edges: .top)
8081

81-
ForEach(items, id: \.self) { item in
82+
ForEach(Array(items.enumerated()), id: \.element) { (index, item) in
8283
optionRow(text: syncable.displayName(for: item),
8384
description: syncable.description(for: item),
8485
isSelected: selectedItems.contains(where: { $0 == syncable.filterItem(for: item) }),
8586
onSelection: { toggleSelectionIfPossible(for: item) })
87+
.if(index == 0 && viewModel.searchQuery.isNotEmpty) {
88+
$0.listRowSeparator(.hidden, edges: .top)
89+
}
8690
}
8791

8892
InfiniteScrollIndicator(showContent: viewModel.shouldShowBottomActivityIndicator)

0 commit comments

Comments
 (0)