Fix glitches when removing account from accountlist
If there are 3 accounts in CC and one is removed, and third is without
icon, then icon of 2 account is coppied to 3rd account.
https://lit.dev/docs/v1/lit-html/writing-templates/#repeating-templates-with-the-repeat-directive
documentation recommends to use repeat when modifyfing list.
That fixes the issue.
Release-Notes: skip
Google-Bug-Id: b/280099940
Change-Id: I36a01a9a5d9f645df05b73cc3a6d64f5dc173167
(cherry picked from commit b8de8fe6d35612eae975156367cb2c69cb9e9da4)
diff --git a/polygerrit-ui/app/elements/shared/gr-account-list/gr-account-list.ts b/polygerrit-ui/app/elements/shared/gr-account-list/gr-account-list.ts
index 8339df9..07209db 100644
--- a/polygerrit-ui/app/elements/shared/gr-account-list/gr-account-list.ts
+++ b/polygerrit-ui/app/elements/shared/gr-account-list/gr-account-list.ts
@@ -36,6 +36,7 @@
import {PaperInputElement} from '@polymer/paper-input/paper-input';
import {IronInputElement} from '@polymer/iron-input';
import {ReviewerState} from '../../../api/rest-api';
+import {repeat} from 'lit/directives/repeat.js';
const VALID_EMAIL_ALERT = 'Please input a valid email.';
const VALID_USER_GROUP_ALERT = 'Please input a valid user or group.';
@@ -186,7 +187,9 @@
override render() {
return html`<div class="list">
- ${this.accounts.map(
+ ${repeat(
+ this.accounts,
+ account => getUserId(account),
account => html`
<gr-account-chip
.account=${account}