Commit b7858e97 authored by Tommy Martino's avatar Tommy Martino Committed by Commit Bot

Chrome Empties: Fix bookmarks title bar bug

This addresses a bug where the title and search bar overlapped in the
NavigationItem in rare cases. Making the call to readd the search bar
before the call to update the title style fixes the behavior, though the
title style now won't change until the user interacts with the screen.

It's hard to say exactly *why* this fixes the issue without some more
knowledge of how UINavigationItem works internally, which we obviously
don't have, but my hunch (and the reason I tried this approach) is that
changing the title style triggers a re-layout of some kind.

Bug: 1116407
Change-Id: I774a1fc9a77a71c01626ddef4dc2586575318a5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2367974Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800365}
parent 15eebebe
...@@ -1508,11 +1508,11 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) { ...@@ -1508,11 +1508,11 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
if (self.sharedState.tableView.backgroundView == self.emptyViewBackground) { if (self.sharedState.tableView.backgroundView == self.emptyViewBackground) {
self.sharedState.tableView.backgroundView = nil; self.sharedState.tableView.backgroundView = nil;
} }
self.navigationItem.searchController = self.searchController;
if ([self isDisplayingBookmarkRoot]) { if ([self isDisplayingBookmarkRoot]) {
self.navigationItem.largeTitleDisplayMode = self.navigationItem.largeTitleDisplayMode =
UINavigationItemLargeTitleDisplayModeAutomatic; UINavigationItemLargeTitleDisplayModeAutomatic;
} }
self.navigationItem.searchController = self.searchController;
} else { } else {
self.sharedState.tableView.backgroundView = nil; self.sharedState.tableView.backgroundView = nil;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment