|
|
@@ -543,16 +543,21 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
543
|
543
|
}
|
|
544
|
544
|
}
|
|
545
|
545
|
|
|
546
|
|
- /// Restores the main job-search experience: cleared query and no listings until the user searches again.
|
|
547
|
|
- private func applyHomeState() {
|
|
548
|
|
- jobKeywordsField.stringValue = ""
|
|
|
546
|
+ /// Removes result cards or the “no matches” message so a new search starts from a blank listing area.
|
|
|
547
|
+ private func clearJobSearchResultsUI() {
|
|
549
|
548
|
configureJobListings([], noResultsForQuery: nil)
|
|
550
|
|
- window?.makeFirstResponder(nil)
|
|
551
|
549
|
if let doc = jobListingsScrollView.documentView {
|
|
552
|
550
|
doc.scroll(NSPoint(x: 0, y: 0))
|
|
553
|
551
|
}
|
|
554
|
552
|
}
|
|
555
|
553
|
|
|
|
554
|
+ /// Restores the main job-search experience: cleared query and no listings until the user searches again.
|
|
|
555
|
+ private func applyHomeState() {
|
|
|
556
|
+ jobKeywordsField.stringValue = ""
|
|
|
557
|
+ clearJobSearchResultsUI()
|
|
|
558
|
+ window?.makeFirstResponder(nil)
|
|
|
559
|
+ }
|
|
|
560
|
+
|
|
556
|
561
|
private func updateSearchBarShadowPath() {
|
|
557
|
562
|
guard searchBarShadowHost.bounds.width > 0, searchBarShadowHost.bounds.height > 0 else { return }
|
|
558
|
563
|
let r = searchBarShadowHost.bounds
|
|
|
@@ -589,6 +594,9 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
589
|
594
|
|
|
590
|
595
|
func controlTextDidBeginEditing(_ obj: Notification) {
|
|
591
|
596
|
applySearchFieldInsertionPoint(obj.object)
|
|
|
597
|
+ if (obj.object as? NSTextField) === jobKeywordsField {
|
|
|
598
|
+ clearJobSearchResultsUI()
|
|
|
599
|
+ }
|
|
592
|
600
|
}
|
|
593
|
601
|
|
|
594
|
602
|
func controlTextDidChange(_ obj: Notification) {
|