Commit ff9f227d authored by Sebastien Lalancette's avatar Sebastien Lalancette Committed by Commit Bot

[iOS] Fix 13.5 ConfirmationAlertViewController Toolbar Done Button

When going from compact width to regular width, we swap the toolbar
buttons. This allows us to add/remove buttons based on the screen
constraints. Before iOS 13.5, setting the "items" property of a
UIToolbar worked fine. However, in 13.5, this made the last button
(Done button) to become non-responsive when going from compact width
to regular width.

Somehow, using the setItems:animated API fixes the issue.

Tested on simulators:
iPhone 13.5 and 12.4
iPAD 13.5 and 12.4

Bug: 1082723
Change-Id: Icde5b6760038560f9f8601af1afc328a4e2e4aae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216285
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Auto-Submit: Sebastien Lalancette <seblalancette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772160}
parent bd57436c
......@@ -265,11 +265,17 @@ constexpr CGFloat kSafeAreaMultiplier = 0.8;
if (isVerticalCompact) {
oldBottomConstraint = self.regularHeightScrollViewBottomVerticalConstraint;
newBottomConstraint = self.compactHeightScrollViewBottomVerticalConstraint;
self.topToolbar.items = self.compactHeightToolbarItems;
// Use setItems:animated method instead of setting the items property, as
// that causes issues with the Done button. See crbug.com/1082723
[self.topToolbar setItems:self.compactHeightToolbarItems animated:YES];
} else {
oldBottomConstraint = self.compactHeightScrollViewBottomVerticalConstraint;
newBottomConstraint = self.regularHeightScrollViewBottomVerticalConstraint;
self.topToolbar.items = self.regularHeightToolbarItems;
// Use setItems:animated method instead of setting the items property, as
// that causes issues with the Done button. See crbug.com/1082723
[self.topToolbar setItems:self.regularHeightToolbarItems animated:YES];
}
newBottomConstraint.constant = -marginValue;
......
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