Skip to content

Commit

Permalink
Bugfix FXIOS-10696 Dismiss search bar when tap on the outside view in…
Browse files Browse the repository at this point in the history
… HistoryPanel (#23276)

* Added Cancel button to searchBar in HistoryPanel to close the keyboard
  • Loading branch information
gokulvenkat243 authored Nov 26, 2024
1 parent 72f84e4 commit 65b7f9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ extension HistoryPanel: UISearchBarDelegate {
performSearch(term: searchText)
}

func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
bottomStackView.isHidden = true
searchBar.resignFirstResponder()
}

func startSearchState() {
updatePanelState(newState: .history(state: .search))
bottomStackView.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class HistoryPanel: UIViewController,
searchbar.searchTextField.placeholder = self.viewModel.searchHistoryPlaceholder
searchbar.returnKeyType = .go
searchbar.delegate = self
searchbar.showsCancelButton = true
}

private lazy var tableView: UITableView = .build { [weak self] tableView in
Expand Down Expand Up @@ -176,7 +177,6 @@ class HistoryPanel: UIViewController,
setupLayout()
configureDataSource()
applyTheme()

// Update theme of already existing view
bottomStackView.applyTheme(theme: currentTheme())
}
Expand Down

0 comments on commit 65b7f9a

Please sign in to comment.