-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Problem
PaneContainerView places a Color.clear overlay above all pane content in the ZStack (dropZonesLayer method). This overlay has .onTapGesture and .onDrop modifiers, which causes it to intercept all mouse events before they reach any AppKit views hosted via NSViewRepresentable underneath.
This breaks AppKit's cursor rect management — for example, NSTableView column header resize cursors never appear because the invisible SwiftUI layer sits on top and blocks the events.
Location
@ViewBuilder
private func dropZonesLayer(size: CGSize) -> some View {
Color.clear
.onTapGesture {
controller.focusPane(pane.id)
}
.onDrop(of: [.text], delegate: UnifiedPaneDropDelegate(
size: size,
pane: pane,
controller: controller,
activeDropZone: $activeDropZone
))
}Fix
Remove the separate Color.clear overlay and apply .onTapGesture and .onDrop directly to contentArea:
ZStack {
contentArea
.onTapGesture {
controller.focusPane(pane.id)
}
.onDrop(of: [.text], delegate: UnifiedPaneDropDelegate(
size: size,
pane: pane,
controller: controller,
activeDropZone: $activeDropZone
))
dropPlaceholder(for: activeDropZone, in: size)
.allowsHitTesting(false)
}This preserves tap-to-focus and tab drag-and-drop while allowing AppKit cursor events to pass through to hosted NSViewRepresentable views.
The dropZonesLayer method can then be removed entirely.