Without Form and Section, I can edit a list:
var body: some View {
List {
ForEach(modeConfigurations.sorted, id: \.id) { item in
Text("\(item.defaultSortIndex)")
}
.onMove(perform: move)
}
.navigationBarItems(trailing:
EditButton()
)
} // Body
I'd like to edit inside a Section of a Form, but it doesn't work there:
var body: some View {
Form{
Section(header: Text("Sort")){
List {
ForEach(modeConfigurations.sorted, id: \.id) { item in
Text("\(item.defaultSortIndex)")
}
.onMove(perform: move)
}
.navigationBarItems(trailing:
EditButton()
)
} // Sort Section
} // Form
} // Body
I can't edit and the Text inside ForEach is not rendered as separate line.
How can I edit a List inside a Section of a Form?

