kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

Support onFocus/onBlur callbacks for input modals #340

Open fabiospampinato opened 1 year ago

fabiospampinato commented 1 year ago

I'm writing a little spotlight-like search, and I'd like to close it automatically when it loses focus, but that doesn't seem exactly implementable today. So maybe input modals should have onFocus and onBlur callbacks.

fabiospampinato commented 1 year ago

I tried using windowDidFocus as a workaround, but for some reason it seems to only be fired once every time a modal is opened, but then it's not fired anymore even if other windows do get the focus.

kasper commented 1 year ago

Makes sense!