I found a solution to the problem, which lies in the fact that when I clicked on the Manage
button, I noticed that the click event would cover the entire VStack
in the Form
.
So every time I clicked on the Manage
button, I actually clicked on all the delete
buttons in the TagView
. It clears the tags
.
To fix it, I simply added .buttonstyle (.plain)
under the Manage
and delete
buttons
Button(action: { showingTagManagement = true }) {
Text("Manage")
}
.buttonStyle(.plain)
Button("test") {
tags.append("test")
}
.buttonStyle(.plain)