Skip to content

Commit

Permalink
Textfield of the homepage is empty and unfocused right after switchin…
Browse files Browse the repository at this point in the history
…g to the homepage (#400)
  • Loading branch information
tomasstrba authored Jan 20, 2022
1 parent 9868df9 commit 7f6ca5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DuckDuckGo/Homepage/View/HomepageHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ final class HomepageHeaderView: NSView {
}

private func updateSearchView() {
if window?.firstResponder != field.currentEditor() {
guard let firstResponder = window?.firstResponder else {
return
}

if firstResponder != field.currentEditor() {
showSearchInactive()
} else if field.isSuggestionWindowVisible {
showSearchHasResults()
Expand Down
5 changes: 5 additions & 0 deletions DuckDuckGo/NavigationBar/View/AddressBarTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ final class AddressBarTextField: NSTextField {
}

private func updateValue() {
guard !isHomepageAddressBar else {
value = .text("")
return
}

guard let selectedTabViewModel = tabCollectionViewModel.selectedTabViewModel else {
return
}
Expand Down

0 comments on commit 7f6ca5e

Please sign in to comment.