Force NSPopover to not become first responder with NSTokenField

后端 未结 4 1536
天命终不由人
天命终不由人 2021-02-09 23:59

I\'m having a NSTokenField and I\'m providing a custom autocompletion inside the popover. Unfortunately as soon as the popover is shown it forces the NSTokenField to resign firs

4条回答
  •  甜味超标
    2021-02-10 00:33

    I happened to stumble upon this problem while designing a custom control to be used within a table view.

    It seems that at least in recent versions of Mac OS X, you can send the table inside your Popover (or whatever focus-stealing view you've got there) a tableView.refusesFirstResponder = true.

    The popover will no longer attempt to steal first responder if you do this.

提交回复
热议问题