Skip to content

Commit

Permalink
Workaround focus problems with password fields
Browse files Browse the repository at this point in the history
Fixes #473 and #464
  • Loading branch information
p0deje committed Jan 14, 2023
1 parent 0f6bfb9 commit e3bacbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Maccy/MenuHeader/MenuHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ class MenuHeaderView: NSView, NSSearchFieldDelegate {
return false
}

if UserDefaults.standard.avoidTakingFocus {
// Sometimes even though we attempt to activate Maccy,
// it doesn't get active. This happens particularly with
// password fields in Safari. Let's at least allow
// search to work in these cases.
// See https://github.com/p0deje/Maccy/issues/473.
if UserDefaults.standard.avoidTakingFocus || !NSApp.isActive {
// append character to the search field to trigger
// and stop event from being propagated
setQuery("\(queryField.stringValue)\(char)")
Expand Down

0 comments on commit e3bacbb

Please sign in to comment.