Force NSPopover to not become first responder with NSTokenField

后端 未结 4 1535
天命终不由人
天命终不由人 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:39

    Make a subclass of your popover content (a text view?) and implement -(void)canBecomeKeyView. Return NO there. It's called only once when the popover is shown, so you can still interact with it, but it doesn't steal the first responder status anymore.

提交回复
热议问题