[iOS][Waffle] Reset correctly SnippetSearchEngineCell to be reused
Fixing issue when a SnippetSearchEngineCell instance is being reused. `-[SnippetSearchEngineCell setSnippetState:]` needs to also update the UI according to the new state. To avoid any problems, this patch also updates -[SnippetSearchEngineCell prepareForReuse] to cleanup all the properties/values/UI. - Search engine label text - Search engine label color - Snippet text - Snippet state with its icon (hidden or shown) - Being selected - Selection icon This patch also moves the following changes from the item to the cell, since those values are invariant: + self.accessibilityTraits |= UIAccessibilityTraitButton; + self.userInteractionEnabled = YES; + self.accessibilityTraits &= ~UIAccessibilityTraitNotEnabled; Fixed: b/317047903 Change-Id: Ic2cbcd0b4445e03f01af07dfc8e4a1a22b836e15 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5136056 Commit-Queue: Menghan Yang <myuu@google.com> Auto-Submit: Jérôme Lebel <jlebel@chromium.org> Commit-Queue: Jérôme Lebel <jlebel@chromium.org> Reviewed-by:Menghan Yang <myuu@google.com> Cr-Commit-Position: refs/heads/main@{#1239679}
Loading
Please register or sign in to comment