Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the issue of navigation bar hiding on tab switch resulting in content visiblity under navigatoin bar in Search tab. #5198

Merged
merged 3 commits into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Wikipedia/Code/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class SearchViewController: ArticleCollectionViewController, WMFNavigationBarCon

private let source: EventLoggingSource

private var presentingSearchResults: Bool = false

// MARK: - Funcs

@objc required init(source: EventLoggingSource) {
Expand Down Expand Up @@ -196,7 +198,7 @@ class SearchViewController: ArticleCollectionViewController, WMFNavigationBarCon

let searchBarConfig = WMFNavigationBarSearchConfig(searchResultsController: nil, searchControllerDelegate: self, searchResultsUpdater: self, searchBarDelegate: self, searchBarPlaceholder: WMFLocalizedString("search-field-placeholder-text", value: "Search Wikipedia", comment: "Search field placeholder text"), showsScopeBar: false, scopeButtonTitles: nil)

configureNavigationBar(titleConfig: titleConfig, closeButtonConfig: nil, profileButtonConfig: profileButtonConfig, searchBarConfig: searchBarConfig, hideNavigationBarOnScroll: true)
configureNavigationBar(titleConfig: titleConfig, closeButtonConfig: nil, profileButtonConfig: profileButtonConfig, searchBarConfig: searchBarConfig, hideNavigationBarOnScroll: !presentingSearchResults)
}

private func updateProfileButton() {
Expand Down Expand Up @@ -663,6 +665,7 @@ extension SearchViewController: UISearchControllerDelegate {
func willPresentSearchController(_ searchController: UISearchController) {
needsAnimateLanguageBarMovement = true
navigationController?.hidesBarsOnSwipe = false
presentingSearchResults = true
}

func willDismissSearchController(_ searchController: UISearchController) {
Expand All @@ -672,6 +675,7 @@ extension SearchViewController: UISearchControllerDelegate {
func didDismissSearchController(_ searchController: UISearchController) {
needsAnimateLanguageBarMovement = false
navigationController?.hidesBarsOnSwipe = true
presentingSearchResults = false
}
}

Expand Down
Loading