NSViews in ScrollViews prevent scrollbars from being draggable

Originator:matt.curtis.biz
Number:rdar://FB9757718 Date Originated:Nov 13, 2021
Status:Open Resolved:
Product:SwiftUI Product Version:
Classification: Reproducible:
 
If you create a ScrollView that contains an NSView that intersects the scroll view's scrollbars, the scrollbars (or "scrollers") in that scroll view can no longer be clicked and dragged in those areas of intersection; clicks go directly to whatever the NSView inside the scroll view is.

This bug appears both with custom NSViewRepresentable-conformances and built-in SwiftUI views that wrap NSViews, like Button (which wraps NSButton.)

The two-finger touchpad scroll gesture works fine — it's clicking and dragging scrollbars that does not. The "Show scroll bars" preference must also set so that macOS only shows scrollbars when you're actively scrolling (i.e. via two-finger gesture). In other words, having that preference set to "Always" will prevent you from seeing this bug.

I've attached a project that demonstrates this issue here, as well as on Github: https://github.com/matt-curtis/macos-scrollview-nsview-scrollbar-bug-demo

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!