So I have exhausted my knowledge/research capabilities in trying to find a solution. I’m creating a custom color picker and decided to place it into a form within a section. Prior to placing it in the section the onTapGesture worked but now it doesn’t. Hoping to figure out what I’m missing.
struct ColorPicker: View {
@Binding var selected: Color
let columns = Array(repeating: GridItem(.flexible()), count: 5)
var body: some View {
LazyVGrid(columns: columns, spacing: 12) {
ForEach(Color.palette, id: \.self) { color in
Circle()
.fill(color)
.frame(width: 45, height: 45)
.overlay {
if selected == color {
Circle()
.stroke()
.fill(Color.white)
.frame(width: 40, height: 40)
}
}
.onTapGesture {
selected = color
}
}
}
}
}