Issue #733
NSTextView
has this handy method to make scrollable NSTextView NSTextView.scrollableTextView()
. The solution is to get to the responder outside enclosing NSScrollView
, in my case it is the SwiftUI hosting view
class DisabledScrollTextView: NSTextView {
override func scrollWheel(with event: NSEvent)
{
// 1st nextResponder is NSClipView
// 2nd nextResponder is NSScrollView
// 3rd nextResponder is NSResponder SwiftUIPlatformViewHost
self.nextResponder?.nextResponder?.nextResponder?.scrollWheel(with: event)
}
}
Then we can construct with our new DisabledScrollTextView.scrollableTextView