Skip to content
Commit 98e18035 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Chromium LUCI CQ
Browse files

[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: default avatarMenghan Yang <myuu@google.com>
Cr-Commit-Position: refs/heads/main@{#1239679}
parent ec23666c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment