#selector(ViewController.backBtnClicked) for NSButton not working Monterey

Viewed 28

So I have a WKWebView & a NSButton on top of it with a

backBtn = NSButton(image: NSImage(named: "NSLeftFacingTriangleTemplate")!, target: self, action: #selector(ViewController.backBtnClicked))

with the function defined as

@objc func backBtnClicked(){}

This is for Swift MacOS app.

All of this was working fine until the new upgrade of Monterey. Now WKWebView opens a PDF in it and the button on top of it. The button works fine in other views that load HTML. It just does not seem to work with the PDF files.

WKWebView such options when you hover on the PDF towards bottom of page such as zoom or download. What I am thinking is that those options are overtaking the button click which was not the case before Monterey. So my question is if

  • this is a known bug or
  • if there is any workaround or
  • if there is any setting option with WKWebView so that I can disable those option when a PDF file opens in it
0 Answers
Related