List reordering doesn't work in a popover on Sonoma

List items do not appear to be moveable when they are contained within a popover on Mac Catalyst running on macOS Sonoma. Dragging and dropping a list item simply returns it to its original location, and onMove(preform:) is not called. The same happens using the drag handles with an EditButton() or .environment(\.editMode, .constant(.active)).

Below is a reproducible sample which, to my knowledge, worked as expected on Ventura. It also currently works as expected on iPad. Changing the popover to a sheet makes it work on Mac Catalyst, but then, the view takes up a lot of unnecessary space.

Does anyone have any good workarounds for this issue?

struct ContentView: View {
    @State private var isShowingPopover = false
    
    @State private var items = ["one", "two", "three"]
    
    var body: some View {
        Button("Show Popover") {
            isShowingPopover = true
        }
        .popover(isPresented: $isShowingPopover) {
            List {
                ForEach(items, id: \.self) { item in
                    Text(item)
                }
                .onMove { fromOffsets, toOffset in
                    items.move(fromOffsets: fromOffsets, toOffset: toOffset)
                }
            }
            .frame(minWidth: 300, minHeight: 270)
        }
    }
}
Post not yet marked as solved Up vote post of caleb_ras Down vote post of caleb_ras
398 views

Replies

Also having the same issue here on our flagship app. Running the same app on Ventura works perfectly fine. This is a Sonoma bug that needs to be fixed! Drag and drop reordering malfunctions as well.