I have a Form Section which I want to show some text and the EditButton() within the same header line as shown below:
The issue occurs when I tap the button whenever its embedded within an HStack. The button text toggles between "Edit" and "Done", yet it doesn't call the onDelete() action for the rows. However, it does work if it's solely assigned as the header, footer, or embedded in a Group arrangement for the Section.
Section(header: HStack { Text("Recent"); Spacer(); EditButton() }) {
ForEach(locationsList, id:\.self) { location in
Text("\(location.name)")
}.onDelete(perform: deleteLocation)
}
Does anyone have any reasoning why my ForEach loop wouldn't be responding to the button when it's embedded in a view arrangement such as an HStack, VStack, or even a ZStack? Is there an alternative to achieve the same layout for the header without using an HStack?

