After a good night of sleep and jumping back into trial and error today, I seem to have narrowed down what was causing the issue.
The solution appears to be a combination of removing .listRowBackground(Color.clear)
from the ItemCellView.
List(viewModel.enabledCategories, id: \.self, selection: $selections.selectedCategory) { category in
ItemCellView(title: category.name, image: category.image)
.listRowSeparator(.hidden)
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
// .listRowBackground(Color.clear)
.background(.clear)
.buttonStyle(.plain)
}
Then also removing .listStyle(.plain)
from the CustomListStyle modifier.
struct CustomListStyle: ViewModifier {
func body(content: Content) -> some View {
content
// .listStyle(.plain)
.listRowSpacing(10)
.scrollIndicators(.hidden)
.scrollContentBackground(.hidden)
.background(Color.clear)
.padding(.top, 10)
.buttonStyle(.plain)
}
}
Thank you to those who have contributed to this post, I appreciate the time and effort put in. Happy to have found a solution to this so I may move on and stop obsessing about it.