I have been looking around but couldn't find the solution so lets hope someone can help me.
I have a ScrollView with a LazyVStack in it. Then I have a list of 'cells'. Simplified it looks something like
Button(action: { ... }) {
HStack {
Text("Title")
Button(action: { ... }) {
Text("Sub action")
}
.buttonStyle(FancyButtonStyle())
}
}
.buttonStyle(CellBackgroundStyle())
The correct actions are triggered when tapped. But the problem is that when I tap the 'sub action' the 'CellBackgroundStyle' is triggered.
I did consider making the main button as the background but that did not work. Also putting them below each other would not work since I want a 'full cell tap animation'.
So does anyone here can explain to me how we can nest buttons in SwiftUI where the child does not trigger the parent animation?
Thanks in advance =]