Minimal SwiftUI iOS app that demonstrates the bug where dropDestination does not work when both the drag source and drop target are inside the same List.
Reference: Apple Developer Forums – dropDestination does not work inside List (thread 730367). Related Feedback: FB12980427.
- Xcode: 15.x / 16.x (as available)
- iOS deployment target: 16.0+
- Platform: iOS (bug is iOS-specific; macOS may behave differently)
- Open
DropDestinationListBug.xcodeprojin Xcode. - Select an iOS simulator or device (e.g. iPhone 15, iOS 17).
- Build and run (⌘R).
- Run the app on iOS (simulator or device).
- Ensure the segmented control at the top is set to "List (broken)".
- Long-press on the text "Drag this" and drag it downward onto the pink "Drop here" area.
- Observe: The drop zone does not highlight (no blue border), and releasing the drag does nothing. Neither the
isTargetedclosure nor the drop action is called.
- While dragging over the drop zone, it should show visual feedback (blue border from
isTargeted). - On drop, the drop zone should accept the string and display "Last: demo".
This is exactly what happens when you switch to "VStack (works)" and repeat the same drag-and-drop.
- With List: The drop destination inside the same
Listnever receives the drag. No highlight, no drop. ThedropDestination(for:action:isTargeted:)modifier appears to be ignored when the drop target is a subview of the sameListthat contains the.draggablesource. - With VStack: Drag and drop works as expected.
- Category: SwiftUI
- Title (suggestion): "dropDestination not called when drop target is inside same List as drag source (iOS)"
- Description: Summarize the issue and include the steps above. Attach this project (zip the repo or the
DropDestinationListBugfolder and the.xcodeproj). - Optional: Screen recording comparing List (no response) vs VStack (response) on iOS.