It seems when using a LazyVGrid inside a List, the dragging behaviour breaks. Consider this:
List {
Section {
Text("Some section")
}
Section {
LazyVGrid(columns: columns, spacing: 32) {
ForEach(items) { item in
Text("(item.id.hashValue)")
.frame(width: 50, height: 50)
.background(Color.green)
.onDrag {
self.dragging = item
return NSItemProvider(object: "(item.id)" as NSString)
}
}
}
}
}
Trying to drag a block of text results in dragging the whole section:
How do I prevent the surrounding list from hijacking the dragging behaviour?