New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quickActionBarDidCancel not being called when user clicks outside the bar #3
Comments
If your application is not frontmost (ie the window that accepts events), the quick action bar will not be presented (as the quick action bar window cannot become main window IF the application is not frontmost.) Using the code you provided in #2, adding NSApp.activate(ignoringOtherApps: true) to the start of the @objc func toggleSearch(_ sender: Any?) {
NSApp.activate(ignoringOtherApps: true)
if quickActionBar.isPresenting {
// Hide
quickActionBar.cancel()
} else {
// Show
self.quickActionBar.present(
parentWindow: nil,
placeholderText: "Search Filters",
searchImage: NSImage(systemSymbolName: "books.vertical", accessibilityDescription: "books.vertical"),
width: min(800, max(500, 200 + 50))
) {
Swift.print("Quick action bar closed")
}
}
} Please let me know if this solves your issue. |
I'm not sure whether I should automatically call |
Okay I've added the call to the |
Perfect thank you! I've made changes to the bar to make copy/paste/cut/select all work in the NSTextField even with a menu bar app. I've also modified the appearance (background and height) to make it match Spotlight Search a bit more. Would you like me to submit a pull request? |
Absolutely! I’d love to see what you’ve done. |
Great will do so asap! Honestly it's not much compared to what you've done with this library, looks great! Just looking into accessing row indices to display different views for items (unfortunately the search term isn't enough) |
Hello, I hope you're well! I'm having an issue whereby after clicking outside the search bar, it stops showing up on subsequent calls, even though
isPresenting
is logging the correct values.In other words,
quickActionBarDidCancel
is called when the user pressedesc
but not when clicking outside the bar. Currently being called as so:Otherwise when presenting the bar with the completion handler, the statement is logged, but the bar stop showing up on subsequent calls to present.
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: