From fe7fa78d65c6f799e64c0c8f635a2d53e1638eea Mon Sep 17 00:00:00 2001 From: Javier Ernesto Flores Robles Date: Wed, 5 Dec 2018 13:37:05 +0000 Subject: [PATCH] [iOS][MF] Fix constraints on password cell Clears the vertical constraints for reuse. Removes extra vertical constraints from separator. Bug: 878388, 845472 Change-Id: I5ba9efdacd2ac642361069b241a9e53956edc215 Reviewed-on: https://chromium-review.googlesource.com/c/1355137 Reviewed-by: Yi Su Commit-Queue: Javier Ernesto Flores Robles Cr-Original-Commit-Position: refs/heads/master@{#612609}(cherry picked from commit 3f9e02a91564e3bd3a7a026e5982697cacefa886) Reviewed-on: https://chromium-review.googlesource.com/c/1363272 Reviewed-by: Javier Ernesto Flores Robles Cr-Commit-Position: refs/branch-heads/3626@{#73} Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437} --- .../manual_fill/manual_fill_password_cell.mm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.mm b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.mm index cdc37b1f711e..2377926f6d69 100644 --- a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.mm +++ b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.mm @@ -107,15 +107,23 @@ @implementation ManualFillPasswordCell - (void)prepareForReuse { [super prepareForReuse]; + [NSLayoutConstraint deactivateConstraints:self.verticalConstraints]; + self.verticalConstraints = @[]; + self.siteNameLabel.text = @""; + [self.usernameButton setTitle:@"" forState:UIControlStateNormal]; self.usernameButton.enabled = YES; [self.usernameButton setTitleColor:UIColor.cr_manualFillTintColor forState:UIControlStateNormal]; + [self.passwordButton setTitle:@"" forState:UIControlStateNormal]; self.passwordButton.accessibilityLabel = nil; self.passwordButton.hidden = NO; + self.manualFillCredential = nil; + + self.grayLine.hidden = NO; } - (void)setUpWithCredential:(ManualFillCredential*)credential @@ -183,10 +191,7 @@ - (void)setUpWithCredential:(ManualFillCredential*)credential self.passwordButton.hidden = YES; } - if (!isConnectedToNextCell) { - [verticalLeadViews addObject:self.grayLine]; - self.grayLine.hidden = NO; - } else { + if (isConnectedToNextCell) { self.grayLine.hidden = YES; }