         
         if didClickSearchButton {
             didClickSearchButton = false
-        } else {
+        } else if shouldSetSearchVisible {
             setSearchVisible(false, animated: shouldAnimateSearchBar)
         }
         

        guard !isAnimatingSearchBarState else {
            return false
        }
        setSearchVisible(true, animated: shouldAnimateSearchBar)
        return true
    }


    
    @objc var areRecentSearchesEnabled: Bool = true
    @objc var shouldBecomeFirstResponder: Bool = false

    var displayType: NavigationBarDisplayType = .largeTitle
    var shouldSetSearchVisible: Bool = true
    var shouldSetTitleViewWhenRecentSearchesAreDisabled: Bool = true

    var shouldShowCancelButton: Bool = true
    var delegatesSelection: Bool = false {
