From 9b489db992f7d447c9c09b16ed7ecc152a3084fe Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 13 Oct 2022 13:28:25 +0300 Subject: [PATCH] Merge branch 'hotfix/1.9.8' into master --- Riot/Categories/UIViewController+RiotSearch.m | 11 ++++++++--- .../Common/SwiftUI/VectorHostingController.swift | 10 +++++++--- changelog.d/6762.bugfix | 1 + changelog.d/6833.bugfix | 1 + 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 changelog.d/6762.bugfix create mode 100644 changelog.d/6833.bugfix diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 76d3af9725..98556960fe 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -89,8 +89,12 @@ - (void)showSearch:(BOOL)animated self.navigationItem.leftBarButtonItem = nil; // Add the search bar - self.navigationItem.titleView = self.searchBar; - + UIView *searchBarContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)]; + searchBarContainer.backgroundColor = [UIColor clearColor]; + searchBarContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth; + + self.navigationItem.titleView = searchBarContainer; + [searchBarContainer addSubview:self.searchBar]; self.extendedLayoutIncludesOpaqueBars = YES; // On iPad, there is no cancel button inside the UISearchBar @@ -177,8 +181,9 @@ - (UIViewControllerRiotSearchInternals *)searchInternals // Initialise internal data at the first call searchInternals = [[UIViewControllerRiotSearchInternals alloc] init]; - UISearchBar *searchBar = [[UISearchBar alloc] init]; + UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)]; searchBar.showsCancelButton = YES; + searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth; searchBar.delegate = (id)self; searchInternals.searchBar = searchBar; diff --git a/Riot/Modules/Common/SwiftUI/VectorHostingController.swift b/Riot/Modules/Common/SwiftUI/VectorHostingController.swift index 98faba5c03..493c29560f 100644 --- a/Riot/Modules/Common/SwiftUI/VectorHostingController.swift +++ b/Riot/Modules/Common/SwiftUI/VectorHostingController.swift @@ -88,9 +88,13 @@ class VectorHostingController: UIHostingController { override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() - if let navigationController = navigationController, navigationController.isNavigationBarHidden != isNavigationBarHidden { - navigationController.isNavigationBarHidden = isNavigationBarHidden - } + guard + let navigationController = navigationController, + navigationController.topViewController == self, + navigationController.isNavigationBarHidden != isNavigationBarHidden + else { return } + + navigationController.isNavigationBarHidden = isNavigationBarHidden } override func viewDidLayoutSubviews() { diff --git a/changelog.d/6762.bugfix b/changelog.d/6762.bugfix new file mode 100644 index 0000000000..78e6b08b93 --- /dev/null +++ b/changelog.d/6762.bugfix @@ -0,0 +1 @@ +Element freezes after searching in a room. \ No newline at end of file diff --git a/changelog.d/6833.bugfix b/changelog.d/6833.bugfix new file mode 100644 index 0000000000..4ea819b834 --- /dev/null +++ b/changelog.d/6833.bugfix @@ -0,0 +1 @@ +All Chats: Fix a header glitch when aborting a pop gesture.