From c00b804672f64ff98ebcf5e9e4e0a42ac08698d6 Mon Sep 17 00:00:00 2001 From: Shunmugaraj Date: Mon, 10 Oct 2022 09:02:17 +0300 Subject: [PATCH 1/2] Bugfix: Element freezes after searching in a room #6762 --- Riot/Categories/UIViewController+RiotSearch.m | 11 ++++++++--- changelog.d/6762.bugfix | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 changelog.d/6762.bugfix diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 76d3af972..93d67b7c8 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -89,8 +89,12 @@ self.navigationItem.leftBarButtonItem = nil; // Add the search bar - self.navigationItem.titleView = self.searchBar; - + UIView *ctrl = [[UIView alloc] initWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width, 44)]; + ctrl.backgroundColor = [UIColor clearColor]; + ctrl.autoresizingMask = UIViewAutoresizingFlexibleWidth; + + self.navigationItem.titleView = ctrl; + [ctrl addSubview:self.searchBar]; self.extendedLayoutIncludesOpaqueBars = YES; // On iPad, there is no cancel button inside the UISearchBar @@ -177,8 +181,9 @@ // 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/changelog.d/6762.bugfix b/changelog.d/6762.bugfix new file mode 100644 index 000000000..78e6b08b9 --- /dev/null +++ b/changelog.d/6762.bugfix @@ -0,0 +1 @@ +Element freezes after searching in a room. \ No newline at end of file From cdee298170b60053ff4e02d3ec637792256565b1 Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 10 Oct 2022 10:50:13 +0100 Subject: [PATCH 2/2] Tidy-up formatting. --- Riot/Categories/UIViewController+RiotSearch.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Riot/Categories/UIViewController+RiotSearch.m b/Riot/Categories/UIViewController+RiotSearch.m index 93d67b7c8..98556960f 100644 --- a/Riot/Categories/UIViewController+RiotSearch.m +++ b/Riot/Categories/UIViewController+RiotSearch.m @@ -89,12 +89,12 @@ self.navigationItem.leftBarButtonItem = nil; // Add the search bar - UIView *ctrl = [[UIView alloc] initWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width, 44)]; - ctrl.backgroundColor = [UIColor clearColor]; - ctrl.autoresizingMask = UIViewAutoresizingFlexibleWidth; + UIView *searchBarContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)]; + searchBarContainer.backgroundColor = [UIColor clearColor]; + searchBarContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth; - self.navigationItem.titleView = ctrl; - [ctrl addSubview:self.searchBar]; + self.navigationItem.titleView = searchBarContainer; + [searchBarContainer addSubview:self.searchBar]; self.extendedLayoutIncludesOpaqueBars = YES; // On iPad, there is no cancel button inside the UISearchBar @@ -181,7 +181,7 @@ // Initialise internal data at the first call searchInternals = [[UIViewControllerRiotSearchInternals alloc] init]; - UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width, 44)]; + UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)]; searchBar.showsCancelButton = YES; searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth; searchBar.delegate = (id)self;